QGIS API Documentation 3.32.0-Lima (311a8cb8a6)
Classes | Typedefs | Enumerations | Functions
QgsWms Namespace Reference

Median cut implementation. More...

Classes

class  QgsBadRequestException
 Exception thrown in case of malformed request. More...
 
class  QgsMapRendererJobProxy
 Proxy for sequential or parallel map render job. More...
 
class  QgsRenderer
 Map renderer for WMS requests. More...
 
class  QgsSecurityException
 Exception thrown when data access violates access controls. More...
 
class  QgsServiceException
 Exception class for WMS service exceptions. More...
 
class  QgsWmsParameter
 WMS parameter received from the client. More...
 
class  QgsWmsParameters
 Provides an interface to retrieve and manipulate WMS parameters received from the client. More...
 
struct  QgsWmsParametersComposerMap
 
struct  QgsWmsParametersExternalLayer
 
struct  QgsWmsParametersFilter
 
struct  QgsWmsParametersHighlightLayer
 
struct  QgsWmsParametersLayer
 
class  QgsWmsRenderContext
 Rendering context for the WMS renderer. More...
 
class  QgsWmsRequest
 Class defining request interface passed to WMS service. More...
 
class  QgsWmsRestorer
 RAII class to restore the rendering context configuration on destruction. More...
 
class  Service
 OGC web service specialized for WMS. More...
 

Typedefs

typedef QList< QPair< QRgb, int > > QgsColorBox
 
typedef QMultiMap< int, QgsColorBoxQgsColorBoxMap
 

Enumerations

enum class  ImageOutputFormat {
  Unknown , PNG , PNG8 , PNG16 ,
  PNG1 , JPEG , WEBP
}
 Supported image output format. More...
 

Functions

void checkParameters (QgsWmsParameters &parameters)
 checkParameters checks request parameters and sets SRCHEIGHT and SRCWIDTH to default values in case BBOX is specified for contextual legend and (SRC)HEIGHT or (SRC)WIDTH are not. More...
 
QMap< QString, QgsRectanglecombineCrsExtents (const QStringList &layerIds, const QMap< QString, QgsWmsLayerInfos > &wmsLayerInfos)
 Returns the combinations of the extent CRSes of the layers from the list of layers ids. More...
 
QgsRectangle combineWgs84BoundingRect (const QStringList &layerIds, const QMap< QString, QgsWmsLayerInfos > &wmsLayerInfos)
 Returns the combination of the WGS84 bounding rectangle of the layers from the list of layers ids. More...
 
QDomDocument describeLayer (QgsServerInterface *serverIface, const QgsProject *project, const QgsWmsRequest &request)
 DescribeLayer is defined for WMS1.1.1/SLD1.0 and in WMS 1.3.0 SLD Extension. More...
 
QDomDocument getCapabilities (QgsServerInterface *serverIface, const QgsProject *project, const QgsWmsRequest &request, bool projectSettings)
 Creates the WMS GetCapabilities XML document. More...
 
QDomElement getCapabilityElement (QDomDocument &doc, const QgsProject *project, const QgsWmsRequest &request, bool projectSettings, QgsServerInterface *serverIface)
 Create Capability element for get capabilities document. More...
 
QDomElement getComposerTemplatesElement (QDomDocument &doc, const QgsProject *project)
 Create ComposerTemplates element for get capabilities document. More...
 
QDomDocument getContext (QgsServerInterface *serverIface, const QgsProject *project, const QgsWmsRequest &request)
 Returns XML document for the 'GetContext' request. More...
 
QDomElement getInspireCapabilitiesElement (QDomDocument &doc, const QgsProject *project)
 Create InspireCapabilities element for get capabilities document. More...
 
QDomElement getLayersAndStylesCapabilitiesElement (QDomDocument &doc, QgsServerInterface *serverIface, const QgsProject *project, const QgsWmsRequest &request, bool projectSettings)
 Create element for get capabilities document. More...
 
QDomElement getServiceElement (QDomDocument &doc, const QgsProject *project, const QgsWmsRequest &request, const QgsServerSettings *serverSettings)
 Create Service element for get capabilities document. More...
 
QDomDocument getStyles (QgsServerInterface *serverIface, const QgsProject *project, const QgsWmsRequest &request)
 Returns an SLD file with the styles of the requested layers. More...
 
QDomElement getWFSLayersElement (QDomDocument &doc, const QgsProject *project)
 Create WFSLayers element for get capabilities document. More...
 
void handleLayersFromTreeGroup (QDomDocument &doc, QDomElement &parentLayer, QgsServerInterface *serverIface, const QgsProject *project, const QgsWmsRequest &request, const QgsLayerTreeGroup *layerTreeGroup, const QMap< QString, QgsWmsLayerInfos > &wmsLayerInfos, bool projectSettings)
 
bool hasQueryableLayers (const QStringList &layerIds, const QMap< QString, QgsWmsLayerInfos > &wmsLayerInfos)
 Returns true if at least one layer from the layers ids is queryable. More...
 
QString implementationVersion ()
 Returns the highest version supported by this implementation. More...
 
QgsLayerTreelayerTree (const QgsWmsRenderContext &context)
 
QgsLayerTreelayerTreeWithGroups (const QgsWmsRenderContext &context, QgsLayerTree *projectRoot)
 
QgsLayerTreeModellegendModel (const QgsWmsRenderContext &context, QgsLayerTree &tree)
 
QgsLayerTreeModelLegendNodelegendNode (const QString &rule, QgsLayerTreeModel &model)
 
void medianCut (QVector< QRgb > &colorTable, int nColors, const QImage &inputImage)
 Median cut implementation used when reducing RGB colors to palletized colors. More...
 
ImageOutputFormat parseImageFormat (const QString &format)
 Parse image format parameter. More...
 
QUrl serviceUrl (const QgsServerRequest &request, const QgsProject *project, const QgsServerSettings &settings)
 Returns WMS service URL. More...
 
void writeAsDxf (QgsServerInterface *serverIface, const QgsProject *project, const QgsWmsRequest &request, QgsServerResponse &response)
 Output GetMap response in DXF format. More...
 
void writeDescribeLayer (QgsServerInterface *serverIface, const QgsProject *project, const QgsWmsRequest &request, QgsServerResponse &response)
 Output GetMap response in DXF format. More...
 
void writeGetCapabilities (QgsServerInterface *serverIface, const QgsProject *project, const QgsWmsRequest &request, QgsServerResponse &response, bool projectSettings=false)
 Output GetCapabilities response. More...
 
void writeGetContext (QgsServerInterface *serverIface, const QgsProject *project, const QgsWmsRequest &request, QgsServerResponse &response)
 Output GetContext response. More...
 
void writeGetFeatureInfo (QgsServerInterface *serverIface, const QgsProject *project, const QgsWmsRequest &request, QgsServerResponse &response)
 Output GetFeatureInfo response. More...
 
void writeGetLegendGraphics (QgsServerInterface *serverIface, const QgsProject *project, const QgsWmsRequest &request, QgsServerResponse &response)
 Output GetLegendGRaphics response. More...
 
void writeGetMap (QgsServerInterface *serverIface, const QgsProject *project, const QgsWmsRequest &request, QgsServerResponse &response)
 Output GetMap response in DXF format. More...
 
void writeGetPrint (QgsServerInterface *serverIface, const QgsProject *project, const QgsWmsRequest &request, QgsServerResponse &response)
 Output GetPrint response. More...
 
void writeGetSchemaExtension (QgsServerResponse &response)
 Output GetSchemaExtension response. More...
 
void writeGetStyles (QgsServerInterface *serverIface, const QgsProject *project, const QgsWmsRequest &request, QgsServerResponse &response)
 Output GetStyles response. More...
 
void writeImage (QgsServerResponse &response, QImage &img, const QString &formatStr, int imageQuality=-1)
 Write image response. More...
 

Detailed Description

Median cut implementation.

WMS implementation.

WMS implementation

Typedef Documentation

◆ QgsColorBox

typedef QList< QPair<QRgb, int> > QgsWms::QgsColorBox

Definition at line 31 of file qgsmediancut.cpp.

◆ QgsColorBoxMap

typedef QMultiMap< int, QgsColorBox > QgsWms::QgsColorBoxMap

Definition at line 32 of file qgsmediancut.cpp.

Enumeration Type Documentation

◆ ImageOutputFormat

enum class QgsWms::ImageOutputFormat
strong

Supported image output format.

Enumerator
Unknown 

Unknown/invalid format.

PNG 

PNG format.

PNG8 

PNG8 format.

PNG16 

PNG16 format.

PNG1 

PNG1 format.

JPEG 

JPEG format.

WEBP 

WEBP format.

Definition at line 40 of file qgswmsutils.h.

Function Documentation

◆ checkParameters()

void QgsWms::checkParameters ( QgsWmsParameters parameters)

checkParameters checks request parameters and sets SRCHEIGHT and SRCWIDTH to default values in case BBOX is specified for contextual legend and (SRC)HEIGHT or (SRC)WIDTH are not.

Definition at line 182 of file qgswmsgetlegendgraphics.cpp.

◆ combineCrsExtents()

QMap< QString, QgsRectangle > QgsWms::combineCrsExtents ( const QStringList &  layerIds,
const QMap< QString, QgsWmsLayerInfos > &  wmsLayerInfos 
)

Returns the combinations of the extent CRSes of the layers from the list of layers ids.

Parameters
layerIdslist of layer ids
wmsLayerInfosWMS layers definition to build WMS capabilities
Returns
the extent combination of the WGS84 bounding rectangle of the layers from the list of layers ids
Since
QGIS 3.28.0

Definition at line 1891 of file qgswmsgetcapabilities.cpp.

◆ combineWgs84BoundingRect()

QgsRectangle QgsWms::combineWgs84BoundingRect ( const QStringList &  layerIds,
const QMap< QString, QgsWmsLayerInfos > &  wmsLayerInfos 
)

Returns the combination of the WGS84 bounding rectangle of the layers from the list of layers ids.

Parameters
layerIdslist of layer ids
wmsLayerInfosWMS layers definition to build WMS capabilities
Returns
the extent combination of the WGS84 bounding rectangle of the layers from the list of layers ids
Since
QGIS 3.28.0

Definition at line 1854 of file qgswmsgetcapabilities.cpp.

◆ describeLayer()

QDomDocument QgsWms::describeLayer ( QgsServerInterface serverIface,
const QgsProject project,
const QgsWmsRequest request 
)

DescribeLayer is defined for WMS1.1.1/SLD1.0 and in WMS 1.3.0 SLD Extension.

Definition at line 41 of file qgswmsdescribelayer.cpp.

◆ getCapabilities()

QDomDocument QgsWms::getCapabilities ( QgsServerInterface serverIface,
const QgsProject project,
const QgsWmsRequest request,
bool  projectSettings 
)

Creates the WMS GetCapabilities XML document.

Parameters
serverIfaceInterface for plugins
projectProject
requestWMS request
projectSettingsIf true, adds extended project information (does not validate against WMS schema)
Returns
GetCapabilities XML document

Definition at line 154 of file qgswmsgetcapabilities.cpp.

◆ getCapabilityElement()

QDomElement QgsWms::getCapabilityElement ( QDomDocument &  doc,
const QgsProject project,
const QgsWmsRequest request,
bool  projectSettings,
QgsServerInterface serverIface 
)

Create Capability element for get capabilities document.

Definition at line 403 of file qgswmsgetcapabilities.cpp.

◆ getComposerTemplatesElement()

QDomElement QgsWms::getComposerTemplatesElement ( QDomDocument &  doc,
const QgsProject project 
)

Create ComposerTemplates element for get capabilities document.

Definition at line 638 of file qgswmsgetcapabilities.cpp.

◆ getContext()

QDomDocument QgsWms::getContext ( QgsServerInterface serverIface,
const QgsProject project,
const QgsWmsRequest request 
)

Returns XML document for the 'GetContext' request.

Definition at line 93 of file qgswmsgetcontext.cpp.

◆ getInspireCapabilitiesElement()

QDomElement QgsWms::getInspireCapabilitiesElement ( QDomDocument &  doc,
const QgsProject project 
)

Create InspireCapabilities element for get capabilities document.

Definition at line 532 of file qgswmsgetcapabilities.cpp.

◆ getLayersAndStylesCapabilitiesElement()

QDomElement QgsWms::getLayersAndStylesCapabilitiesElement ( QDomDocument &  doc,
QgsServerInterface serverIface,
const QgsProject project,
const QgsWmsRequest request,
bool  projectSettings 
)

Create element for get capabilities document.

Definition at line 810 of file qgswmsgetcapabilities.cpp.

◆ getServiceElement()

QDomElement QgsWms::getServiceElement ( QDomDocument &  doc,
const QgsProject project,
const QgsWmsRequest request,
const QgsServerSettings serverSettings 
)

Create Service element for get capabilities document.

Definition at line 243 of file qgswmsgetcapabilities.cpp.

◆ getStyles()

QDomDocument QgsWms::getStyles ( QgsServerInterface serverIface,
const QgsProject project,
const QgsWmsRequest request 
)

Returns an SLD file with the styles of the requested layers.

Exception is raised in case of troubles :-)

Definition at line 50 of file qgswmsgetstyles.cpp.

◆ getWFSLayersElement()

QDomElement QgsWms::getWFSLayersElement ( QDomDocument &  doc,
const QgsProject project 
)

Create WFSLayers element for get capabilities document.

Definition at line 754 of file qgswmsgetcapabilities.cpp.

◆ handleLayersFromTreeGroup()

void QgsWms::handleLayersFromTreeGroup ( QDomDocument &  doc,
QDomElement &  parentLayer,
QgsServerInterface serverIface,
const QgsProject project,
const QgsWmsRequest request,
const QgsLayerTreeGroup layerTreeGroup,
const QMap< QString, QgsWmsLayerInfos > &  wmsLayerInfos,
bool  projectSettings 
)

Definition at line 784 of file qgswmsgetcapabilities.cpp.

◆ hasQueryableLayers()

bool QgsWms::hasQueryableLayers ( const QStringList &  layerIds,
const QMap< QString, QgsWmsLayerInfos > &  wmsLayerInfos 
)

Returns true if at least one layer from the layers ids is queryable.

Parameters
layerIdslist of layer ids
wmsLayerInfosWMS layers definition to build WMS capabilities
Returns
True if at least one layer form the layers ids is queryable
Since
QGIS 3.28.0

Definition at line 1838 of file qgswmsgetcapabilities.cpp.

◆ implementationVersion()

QString QgsWms::implementationVersion ( )

Returns the highest version supported by this implementation.

Since
QGIS 3.22.12

Definition at line 33 of file qgswmsutils.cpp.

◆ layerTree()

QgsLayerTree * QgsWms::layerTree ( const QgsWmsRenderContext context)

Definition at line 318 of file qgswmsgetlegendgraphics.cpp.

◆ layerTreeWithGroups()

QgsLayerTree * QgsWms::layerTreeWithGroups ( const QgsWmsRenderContext context,
QgsLayerTree projectRoot 
)

Definition at line 356 of file qgswmsgetlegendgraphics.cpp.

◆ legendModel()

QgsLayerTreeModel * QgsWms::legendModel ( const QgsWmsRenderContext context,
QgsLayerTree tree 
)

Definition at line 238 of file qgswmsgetlegendgraphics.cpp.

◆ legendNode()

QgsLayerTreeModelLegendNode * QgsWms::legendNode ( const QString &  rule,
QgsLayerTreeModel model 
)

Definition at line 390 of file qgswmsgetlegendgraphics.cpp.

◆ medianCut()

void QgsWms::medianCut ( QVector< QRgb > &  colorTable,
int  nColors,
const QImage &  inputImage 
)

Median cut implementation used when reducing RGB colors to palletized colors.

Definition at line 256 of file qgsmediancut.cpp.

◆ parseImageFormat()

ImageOutputFormat QgsWms::parseImageFormat ( const QString &  format)

Parse image format parameter.

Returns
OutputFormat

Definition at line 74 of file qgswmsutils.cpp.

◆ serviceUrl()

QUrl QgsWms::serviceUrl ( const QgsServerRequest request,
const QgsProject project,
const QgsServerSettings settings 
)

Returns WMS service URL.

Definition at line 38 of file qgswmsutils.cpp.

◆ writeAsDxf()

void QgsWms::writeAsDxf ( QgsServerInterface serverIface,
const QgsProject project,
const QgsWmsRequest request,
QgsServerResponse response 
)

Output GetMap response in DXF format.

Definition at line 24 of file qgsdxfwriter.cpp.

◆ writeDescribeLayer()

void QgsWms::writeDescribeLayer ( QgsServerInterface serverIface,
const QgsProject project,
const QgsWmsRequest request,
QgsServerResponse response 
)

Output GetMap response in DXF format.

Definition at line 32 of file qgswmsdescribelayer.cpp.

◆ writeGetCapabilities()

void QgsWms::writeGetCapabilities ( QgsServerInterface serverIface,
const QgsProject project,
const QgsWmsRequest request,
QgsServerResponse response,
bool  projectSettings 
)

Output GetCapabilities response.

Definition at line 77 of file qgswmsgetcapabilities.cpp.

◆ writeGetContext()

void QgsWms::writeGetContext ( QgsServerInterface serverIface,
const QgsProject project,
const QgsWmsRequest request,
QgsServerResponse response 
)

Output GetContext response.

Definition at line 57 of file qgswmsgetcontext.cpp.

◆ writeGetFeatureInfo()

void QgsWms::writeGetFeatureInfo ( QgsServerInterface serverIface,
const QgsProject project,
const QgsWmsRequest request,
QgsServerResponse response 
)

Output GetFeatureInfo response.

Definition at line 27 of file qgswmsgetfeatureinfo.cpp.

◆ writeGetLegendGraphics()

void QgsWms::writeGetLegendGraphics ( QgsServerInterface serverIface,
const QgsProject project,
const QgsWmsRequest request,
QgsServerResponse response 
)

Output GetLegendGRaphics response.

Definition at line 41 of file qgswmsgetlegendgraphics.cpp.

◆ writeGetMap()

void QgsWms::writeGetMap ( QgsServerInterface serverIface,
const QgsProject project,
const QgsWmsRequest request,
QgsServerResponse response 
)

Output GetMap response in DXF format.

Definition at line 31 of file qgswmsgetmap.cpp.

◆ writeGetPrint()

void QgsWms::writeGetPrint ( QgsServerInterface serverIface,
const QgsProject project,
const QgsWmsRequest request,
QgsServerResponse response 
)

Output GetPrint response.

Definition at line 29 of file qgswmsgetprint.cpp.

◆ writeGetSchemaExtension()

void QgsWms::writeGetSchemaExtension ( QgsServerResponse response)

Output GetSchemaExtension response.

Definition at line 32 of file qgswmsgetschemaextension.cpp.

◆ writeGetStyles()

void QgsWms::writeGetStyles ( QgsServerInterface serverIface,
const QgsProject project,
const QgsWmsRequest request,
QgsServerResponse response 
)

Output GetStyles response.

Definition at line 42 of file qgswmsgetstyles.cpp.

◆ writeImage()

void QgsWms::writeImage ( QgsServerResponse response,
QImage &  img,
const QString &  formatStr,
int  imageQuality 
)

Write image response.

Definition at line 111 of file qgswmsutils.cpp.