QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
18 #ifndef QGSWMSRENDERCONTEXT_H
19 #define QGSWMSRENDERCONTEXT_H
34 class QgsWmsRenderContext
54 Q_DECLARE_FLAGS( Flags,
Flag )
103 QList<QgsMapLayer *>
layers()
const;
215 #ifdef HAVE_SERVER_PYTHON_PLUGINS
227 QMap<QString, QList<QgsMapLayer *> >
layerGroups()
const;
240 QSize
mapSize(
bool aspectRatio =
true )
const;
274 void initNicknameLayers();
275 void initRestrictedLayers();
276 void initLayerGroupsRecursive(
const QgsLayerTreeGroup *group,
const QString &groupName );
278 void searchLayersToRender();
279 void searchLayersToRenderSld();
280 void searchLayersToRenderStyle();
281 void removeUnwantedLayers();
283 void checkLayerReadPermissions();
285 bool layerScaleVisibility(
const QString &name )
const;
290 Flags mFlags = Flags();
291 double mScaleDenominator = -1.0;
294 QMultiMap<QString, QgsMapLayer *> mNicknameLayers;
297 QList<QgsMapLayer *> mLayersToRender;
300 QStringList mRestrictedLayers;
302 QMap<QString, QList<QgsMapLayer *> > mLayerGroups;
304 QMap<QString, QDomElement> mSlds;
305 QMap<QString, QString> mStyles;
308 QList<QgsMapLayer *> mExternalLayers;
Provides an interface to retrieve and manipulate WMS parameters received from the client.
int mapWidth() const
Returns WIDTH or SRCWIDTH according to UseSrcWidthHeight flag.
QList< QgsMapLayer * > layersFromGroup(const QString &nickname) const
Returns the group's layers list corresponding to the nickname, or an empty list if not found.
bool isExternalLayer(const QString &name) const
Returns true if the layer is an external layer, false otherwise.
QString style(const QgsMapLayer &layer) const
Returns a style's name for a specific layer.
void setFlag(Flag flag, bool on=true)
Sets or unsets a rendering flag according to the on value.
void setParameters(const QgsWmsParameters ¶meters)
Sets WMS parameters.
bool updateExtent() const
Returns true if the extent has to be updated before the rendering, false otherwise.
QMap< QString, QList< QgsMapLayer * > > layerGroups() const
Returns a map having layer group names as keys and a list of layers as values.
bool isValidWidthHeight() const
Returns true if width and height are valid according to the maximum values defined within the project...
int imageQuality() const
Returns the image quality to use for rendering according to the current configuration.
QgsWmsRenderContext(const QgsProject *project, QgsServerInterface *interface)
Constructor for QgsWmsRenderContext.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Provides a way to retrieve settings by prioritizing according to environment variables,...
int tileBuffer() const
Returns the tile buffer value to use for rendering according to the current configuration.
QSize mapSize(bool aspectRatio=true) const
Returns the size (in pixels) of the map to render, according to width and height WMS parameters as we...
void setScaleDenominator(double scaleDenominator)
Sets a custom scale denominator.
@ AddAllLayers
For GetPrint: add layers from LAYER(S) parameter.
Layer tree group node serves as a container for layers and further groups.
const QgsServerSettings & settings() const
Returns settings of the server.
bool isValidLayer(const QString &nickname) const
Returns true if the layer has to be rendered, false otherwise.
int precision() const
Returns the precision to use according to the current configuration.
QDomElement sld(const QgsMapLayer &layer) const
Returns a SLD document for a specific layer.
Flag
Available rendering options.
QString layerNickname(const QgsMapLayer &layer) const
Returns the nickname (short name, id or name) of the layer according to the current configuration.
bool renderMapTiles() const
Returns true if WMS requests should use the QgsMapSettings::RenderMapTile flag, so that no visible ar...
A helper class that centralizes restrictions given by all the access control filter plugins.
Median cut implementation.
bool isValidGroup(const QString &name) const
Returns true if name is a group.
double scaleDenominator() const
Returns the scale denominator to use for rendering according to the current configuration.
QgsMapLayer * layer(const QString &nickname) const
Returns the layer corresponding to the nickname, or a nullptr if not found or if the layer do not nee...
Base class for all map layer types. This is the base class for all map layer types (vector,...
bool testFlag(Flag flag) const
Returns the status of a rendering flag.
const QgsProject * project() const
Returns the project.
double mapTileBuffer(int mapWidth) const
Returns the tile buffer in geographical units for the given map width in pixels.
~QgsWmsRenderContext()
Destructor for QgsWmsRenderContext.
QStringList flattenedQueryLayers(const QStringList &layerNames) const
Returns a list of query layer names where group names are replaced by the names of their layer compon...
qreal dotsPerMm() const
Returns default dots per mm according to the current configuration.
QList< QgsMapLayer * > layersToRender() const
Returns a list of all layers to actually render according to the current configuration.
int mapHeight() const
Returns HEIGHT or SRCHEIGHT according to UseSrcWidthHeight flag.
QList< QgsMapLayer * > layers() const
Returns a list of all layers read from the project.
QgsServerInterface Class defining interfaces exposed by QGIS Server and made available to plugins.
QgsWmsParameters parameters() const
Returns WMS parameters.