37 const bool &ballparkTransformsAreAppropriate
41 transformer.setBallparkTransformsAreAppropriate( ballparkTransformsAreAppropriate );
43 return transformer.transformBoundingBox( extent );
49 const QList<QgsCoordinateReferenceSystem> &destinations,
62 crsExtents[destination.authid()] = crsTransform.transformBoundingBox( extent );
74 const QList<QgsCoordinateReferenceSystem> &outputCrsList
90 if ( ml->
crs() != project->
crs() )
142 const QList<QgsCoordinateReferenceSystem> &outputCrsList
145 QMap<QString, QgsWmsLayerInfos> wmsLayers;
146#ifdef HAVE_SERVER_PYTHON_PLUGINS
149 ( void ) serverIface;
159 if ( !ml || restrictedLayers.contains( ml->name() ) )
164#ifdef HAVE_SERVER_PYTHON_PLUGINS
172 pLayer.
id = ml->id();
177 bool hasExtent =
true;
188 if ( hasExtent && !
setBoundingRect( project, pLayer, ml, wmsExtent, wgs84, outputCrsList ) )
192 pLayer.
type = ml->type();
194 pLayer.
name = ml->name();
197 pLayer.
name = ml->id();
199 else if ( !ml->serverProperties()->shortName().isEmpty() )
201 pLayer.
name = ml->serverProperties()->shortName();
204 pLayer.
title = ml->serverProperties()->title();
205 if ( pLayer.
title.isEmpty() )
207 pLayer.
title = ml->name();
210 pLayer.
abstract = ml->serverProperties()->abstract();
214 if ( !ml->serverProperties()->keywordList().isEmpty() )
216 pLayer.
keywords = ml->serverProperties()->keywordList().split(
',' );
219 pLayer.
styles = ml->styleManager()->styles();
225 if ( ml->hasScaleBasedVisibility() )
228 pLayer.
maxScale = ml->maximumScale();
229 pLayer.
minScale = ml->minimumScale();
232 pLayer.
dataUrl = ml->serverProperties()->dataUrl();
234 pLayer.
attribution = ml->serverProperties()->attribution();
237 pLayer.
metadataUrls = ml->serverProperties()->metadataUrls();
239 wmsLayers[pLayer.
id] = pLayer;
@ Warning
Warning message.
A helper class that centralizes restrictions given by all the access control filter plugins.
bool layerReadPermission(const QgsMapLayer *layer) const
Returns the layer read right.
This class represents a coordinate reference system (CRS).
static QgsCoordinateReferenceSystem fromOgcWmsCrs(const QString &ogcCrs)
Creates a CRS from a given OGC WMS-format Coordinate Reference System string.
QgsRectangle bounds() const
Returns the approximate bounds for the region the CRS is usable within.
Contains information about the context in which a coordinate transform is executed.
Custom exception class for Coordinate Reference System related exceptions.
Base class for all map layer types.
QgsRectangle wgs84Extent(bool forceRecalculate=false) const
Returns the WGS84 extent (EPSG:4326) of the layer according to ReadFlag::FlagTrustLayerMetadata.
virtual QgsRectangle extent() const
Returns the extent of the layer.
QgsCoordinateReferenceSystem crs
@ Identifiable
If the layer is identifiable using the identify map tool and as a WMS layer.
static void logMessage(const QString &message, const QString &tag=QString(), Qgis::MessageLevel level=Qgis::MessageLevel::Warning, bool notifyUser=true)
Adds a message to the log instance (and creates it if necessary).
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
QgsCoordinateTransformContext transformContext
QgsCoordinateReferenceSystem crs
QMap< QString, QgsMapLayer * > mapLayers(const bool validOnly=false) const
Returns a map of all registered layers by layer ID.
A rectangle specified with double values.
QgsServerInterface Class defining interfaces exposed by QGIS Server and made available to plugins.
virtual QgsAccessControl * accessControls() const =0
Gets the registered access control filters.
Represents a vector layer which manages a vector based data sets.
Q_INVOKABLE Qgis::WkbType wkbType() const FINAL
Returns the WKBType or WKBUnknown in case of error.
QString legendUrlFormat
WMS layer legend URL format.
QString title
WMS layer title.
QStringList styles
WMS layer styles.
QStringList keywords
WMS layer keywords.
QString legendUrl
WMS layer legend URL.
QString abstract
WMS layer abstract.
static QgsRectangle transformExtent(const QgsRectangle &extent, const QgsCoordinateReferenceSystem &source, const QgsCoordinateReferenceSystem &destination, const QgsCoordinateTransformContext &context, const bool &ballparkTransformsAreAppropriate=false)
Returns a transformed extent.
QString attribution
WMS layer attribution.
QString dataUrl
WMS layer dataUrl.
double maxScale
WMS layer maximum scale (if negative, no maximum scale is defined)
QMap< QString, QgsRectangle > crsExtents
WMS layer CRS extents (can be empty)
QString attributionUrl
WMS layer attribution URL.
static QMap< QString, QgsRectangle > transformExtentToCrsList(const QgsRectangle &extent, const QgsCoordinateReferenceSystem &source, const QList< QgsCoordinateReferenceSystem > &destinations, const QgsCoordinateTransformContext &context)
Returns a map with CRS authid as key and the transformed extent as value.
Qgis::LayerType type
QGIS layer type.
QString name
WMS layer name.
static QMap< QString, QgsWmsLayerInfos > buildWmsLayerInfos(QgsServerInterface *serverIface, const QgsProject *project, const QList< QgsCoordinateReferenceSystem > &outputCrsList)
Returns the WMS layers definition to build WMS capabilities.
QList< QgsMapLayerServerProperties::MetadataUrl > metadataUrls
WMS layer metadata URLs.
bool hasScaleBasedVisibility
WMS layer has scale based visibility.
double minScale
WMS layer minimum scale (if negative, no maximum scale is defined)
bool queryable
WMS layer is queryable.
QgsRectangle wgs84BoundingRect
WMS layer WGS84 bounding rectangle (can be empty)
SERVER_EXPORT QgsRectangle wmsExtent(const QgsProject &project)
Returns the WMS Extent restriction.
SERVER_EXPORT bool wmsUseLayerIds(const QgsProject &project)
Returns if layer ids are used as name in WMS.
SERVER_EXPORT QStringList wmsRestrictedLayers(const QgsProject &project)
Returns the restricted layer name list.
CONSTLATIN1STRING geoEpsgCrsAuthId()
Geographic coord sys from EPSG authority.
bool setBoundingRect(const QgsProject *project, QgsWmsLayerInfos &pLayer, QgsMapLayer *ml, const QgsRectangle &wmsExtent, const QgsCoordinateReferenceSystem &wgs84, const QList< QgsCoordinateReferenceSystem > &outputCrsList)