20 #ifndef QGSWMSRENDERER_H 21 #define QGSWMSRENDERER_H 26 #include <QDomDocument> 79 typedef QHash<QgsVectorLayer *, SymbolSet>
HitTest;
85 QImage *
getMap( HitTest *hitTest =
nullptr );
103 QByteArray
getPrint(
const QString &formatString );
114 void initRestrictedLayers();
117 QList<QgsMapLayer *> highlightLayers( QList<QgsWmsParametersHighlightLayer> params );
120 void initNicknameLayers();
122 void initLayerGroupsRecursive(
const QgsLayerTreeGroup *group,
const QString &groupName );
126 QString layerNickname(
const QgsMapLayer &layer )
const;
130 bool layerScaleVisibility(
const QgsMapLayer &layer,
double scaleDenominator )
const;
133 void removeUnwantedLayers( QList<QgsMapLayer *> &layers,
double scaleDenominator = -1 )
const;
136 void removeNonIdentifiableLayers( QList<QgsMapLayer *> &layers )
const;
139 QPainter *layersRendering(
const QgsMapSettings &mapSettings, QImage &image, HitTest *hitTest =
nullptr )
const;
142 void annotationsRendering( QPainter *painter )
const;
145 QList<QgsMapLayer *> stylizedLayers(
const QList<QgsWmsParametersLayer> ¶ms );
148 QList<QgsMapLayer *> sldStylizedLayers(
const QString &sld )
const;
151 void setLayerOpacity(
QgsMapLayer *layer,
int opacity )
const;
154 void setLayerFilter(
QgsMapLayer *layer,
const QList<QgsWmsParametersFilter> &filters );
157 void setLayerAccessControlFilter(
QgsMapLayer *layer )
const;
160 void setLayerSelection(
QgsMapLayer *layer,
const QStringList &fids )
const;
166 QImage *scaleImage(
const QImage *image )
const;
169 void checkLayerReadPermissions(
QgsMapLayer *layer )
const;
175 qreal dotsPerMm()
const;
185 QImage *createImage(
int width = -1,
int height = -1,
bool useBbox =
true )
const;
193 void configureMapSettings(
const QPaintDevice *paintDevice,
QgsMapSettings &mapSettings )
const;
195 QDomDocument featureInfoDocument( QList<QgsMapLayer *> &layers,
const QgsMapSettings &mapSettings,
196 const QImage *outputImage,
const QString &version )
const;
216 QDomDocument &infoDocument,
217 QDomElement &layerElement,
220 const QString &version,
228 QDomDocument &infoDocument,
229 QDomElement &layerElement,
230 const QString &version )
const;
233 void runHitTest(
const QgsMapSettings &mapSettings, HitTest &hitTest )
const;
240 bool testFilterStringSafety(
const QString &filter )
const;
242 static void groupStringList( QStringList &list,
const QString &groupString );
247 bool checkMaximumWidthHeight()
const;
250 void convertFeatureInfoToSia2045( QDomDocument &doc )
const;
253 QByteArray convertFeatureInfoToHtml(
const QDomDocument &doc )
const;
256 QByteArray convertFeatureInfoToText(
const QDomDocument &doc )
const;
259 QByteArray convertFeatureInfoToJson(
const QList<QgsMapLayer *> &layers,
const QDomDocument &doc )
const;
261 QDomElement createFeatureGML(
270 QStringList *attributes =
nullptr )
const;
273 static QString replaceValueMapAndRelation(
QgsVectorLayer *vl,
int idx,
const QVariant &attributeVal );
287 QgsMapLayer *createExternalWMSLayer(
const QString &externalLayerId )
const;
289 void removeTemporaryLayers();
291 void handlePrintErrors(
const QgsLayout *layout )
const;
297 #ifdef HAVE_SERVER_PYTHON_PLUGINS 305 QStringList mRestrictedLayers;
306 QMap<QString, QgsMapLayer *> mNicknameLayers;
307 QMap<QString, QList<QgsMapLayer *> > mLayerGroups;
308 QList<QgsMapLayer *> mTemporaryLayers;
QByteArray getFeatureInfo(const QString &version="1.3.0")
Creates an xml document that describes the result of the getFeatureInfo request.
Layer tree group node serves as a container for layers and further groups.
A rectangle specified with double values.
Base class for all map layer types.
This class provides qgis with the ability to render raster datasets onto the mapcanvas.
A class to represent a 2D point.
int getImageQuality() const
Returns the image quality to use for getMap request.
A geometry is the spatial representation of a feature.
Provides a way to retrieve settings by prioritizing according to environment variables, ini file and default values.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
const QgsCoordinateReferenceSystem & crs
The QgsMapSettings class contains configuration for rendering of the map.
int getWMSPrecision() const
Returns the precision to use for GetFeatureInfo request.
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into c
QImage * getMap(HitTest *hitTest=nullptr)
Returns the map as an image (or a null pointer in case of error).
The QgsLayerTreeModel class is model implementation for Qt item views framework.
QHash< QgsVectorLayer *, SymbolSet > HitTest
QByteArray getPrint(const QString &formatString)
Returns printed page as binary.
QgsDxfExport getDxf(const QMap< QString, QString > &options)
Returns the map as DXF data.
Namespace with helper functions for layer tree operations.
A feature filter provider allowing to set filter expressions on a per-layer basis.
Provides an interface to retrieve and manipulate WMS parameters received from the client...
QImage * getLegendGraphics()
Returns the map legend as an image (or a null pointer in case of error).
Reads and writes project states.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
Median cut implementation.
QSet< QString > SymbolSet
QgsServerInterface Class defining interfaces exposed by QGIS Server and made available to plugins...
Map renderer for WMS requests.
Contains information about the context of a rendering operation.
This class represents a coordinate reference system (CRS).
A helper class that centralizes restrictions given by all the access control filter plugins...
Print layout, a QgsLayout subclass for static or atlas-based layouts.
QgsRenderer(QgsServerInterface *serverIface, const QgsProject *project, const QgsWmsParameters ¶meters)
Constructor.
Represents a vector layer which manages a vector based data sets.