QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
Go to the documentation of this file.
23 double scaleFactor = std::pow( 10.0, places );
24 return ( std::ceil( number * scaleFactor ) / scaleFactor );
29 double scaleFactor = std::pow( 10.0, places );
30 return ( std::floor( number * scaleFactor ) / scaleFactor );
35 return project.
readBoolEntry( QStringLiteral(
"WMSServiceCapabilities" ), QStringLiteral(
"/" ),
false );
40 return project.
readEntry( QStringLiteral(
"WMSServiceTitle" ), QStringLiteral(
"/" ) );
45 return project.
readEntry( QStringLiteral(
"WMSServiceAbstract" ), QStringLiteral(
"/" ) );
50 QStringList keywordList;
51 QStringList list = project.
readListEntry( QStringLiteral(
"WMSKeywordList" ), QStringLiteral(
"/" ), QStringList() );
52 if ( !list.isEmpty() )
54 for (
int i = 0; i < list.size(); ++i )
56 QString keyword = list.at( i );
57 if ( !keyword.isEmpty() )
59 keywordList.append( keyword );
68 QString wmsOnlineResource = project.
readEntry( QStringLiteral(
"WMSOnlineResource" ), QStringLiteral(
"/" ) );
74 return wmsOnlineResourceProperty.
valueAsString( context, wmsOnlineResource );
77 return wmsOnlineResource;
82 return project.
readEntry( QStringLiteral(
"WMSContactOrganization" ), QStringLiteral(
"/" ) );
87 return project.
readEntry( QStringLiteral(
"WMSContactPosition" ), QStringLiteral(
"/" ) );
92 return project.
readEntry( QStringLiteral(
"WMSContactPerson" ), QStringLiteral(
"/" ) );
97 return project.
readEntry( QStringLiteral(
"WMSContactMail" ), QStringLiteral(
"/" ) );
102 return project.
readEntry( QStringLiteral(
"WMSContactPhone" ), QStringLiteral(
"/" ) );
107 return project.
readEntry( QStringLiteral(
"WMSFees" ), QStringLiteral(
"/" ) );
112 return project.
readEntry( QStringLiteral(
"WMSAccessConstraints" ), QStringLiteral(
"/" ) );
117 return project.
readNumEntry( QStringLiteral(
"WMSMaxWidth" ), QStringLiteral(
"/" ), -1 );
122 return project.
readNumEntry( QStringLiteral(
"WMSMaxHeight" ), QStringLiteral(
"/" ), -1 );
127 return project.
readBoolEntry( QStringLiteral(
"WMSUseLayerIDs" ), QStringLiteral(
"/" ),
false );
132 return project.
readNumEntry( QStringLiteral(
"WMSImageQuality" ), QStringLiteral(
"/" ), -1 );
137 return project.
readNumEntry( QStringLiteral(
"WMSTileBuffer" ), QStringLiteral(
"/" ), 0 );
142 return project.
readNumEntry( QStringLiteral(
"WMSMaxAtlasFeatures" ), QStringLiteral(
"/" ), 1 );
147 return project.
readDoubleEntry( QStringLiteral(
"WMSDefaultMapUnitsPerMm" ), QStringLiteral(
"/" ), 1 );
152 QString sia2045 = project.
readEntry( QStringLiteral(
"WMSInfoFormatSIA2045" ), QStringLiteral(
"/" ),
"" );
154 return sia2045.compare( QLatin1String(
"enabled" ), Qt::CaseInsensitive ) == 0
155 || sia2045.compare( QLatin1String(
"true" ), Qt::CaseInsensitive ) == 0;
160 QString wktGeom = project.
readEntry( QStringLiteral(
"WMSAddWktGeometry" ), QStringLiteral(
"/" ),
"" );
162 return wktGeom.compare( QLatin1String(
"enabled" ), Qt::CaseInsensitive ) == 0
163 || wktGeom.compare( QLatin1String(
"true" ), Qt::CaseInsensitive ) == 0;
168 QString segmGeom = project.
readEntry( QStringLiteral(
"WMSSegmentizeFeatureInfoGeometry" ), QStringLiteral(
"/" ),
"" );
170 return segmGeom.compare( QLatin1String(
"enabled" ), Qt::CaseInsensitive ) == 0
171 || segmGeom.compare( QLatin1String(
"true" ), Qt::CaseInsensitive ) == 0;
176 return project.
readNumEntry( QStringLiteral(
"WMSPrecision" ), QStringLiteral(
"/" ), 6 );
181 return project.
readEntry( QStringLiteral(
"WMSFeatureInfoDocumentElement" ), QStringLiteral(
"/" ),
"" );
186 return project.
readEntry( QStringLiteral(
"WMSFeatureInfoDocumentElementNS" ), QStringLiteral(
"/" ),
"" );
191 return project.
readEntry( QStringLiteral(
"WMSFeatureInfoSchema" ), QStringLiteral(
"/" ),
"" );
196 QHash<QString, QString> aliasMap;
199 QStringList aliasLayerStringList = project.
readListEntry( QStringLiteral(
"WMSFeatureInfoAliasLayers" ), QStringLiteral(
"/value" ), QStringList() );
200 if ( aliasLayerStringList.isEmpty() )
206 QStringList layerAliasStringList = project.
readListEntry( QStringLiteral(
"WMSFeatureInfoLayerAliases" ), QStringLiteral(
"/value" ), QStringList() );
207 if ( layerAliasStringList.isEmpty() )
212 int nMapEntries = std::min( aliasLayerStringList.size(), layerAliasStringList.size() );
213 for (
int i = 0; i < nMapEntries; ++i )
215 aliasMap.insert( aliasLayerStringList.at( i ), layerAliasStringList.at( i ) );
223 return project.
readBoolEntry( QStringLiteral(
"WMSInspire" ), QStringLiteral(
"/activated" ) );
228 return project.
readEntry( QStringLiteral(
"WMSInspire" ), QStringLiteral(
"/language" ) );
233 return project.
readEntry( QStringLiteral(
"WMSInspire" ), QStringLiteral(
"/metadataUrl" ) );
238 return project.
readEntry( QStringLiteral(
"WMSInspire" ), QStringLiteral(
"/metadataUrlType" ) );
243 return project.
readEntry( QStringLiteral(
"WMSInspire" ), QStringLiteral(
"/temporalReference" ) );
248 return project.
readEntry( QStringLiteral(
"WMSInspire" ), QStringLiteral(
"/metadataDate" ) );
253 return project.
readListEntry( QStringLiteral(
"WMSRestrictedComposers" ), QStringLiteral(
"/" ), QStringList() );
259 QStringList wmsCrsList = project.
readListEntry( QStringLiteral(
"WMSCrsList" ), QStringLiteral(
"/" ), QStringList() );
260 if ( !wmsCrsList.isEmpty() )
262 for (
int i = 0; i < wmsCrsList.size(); ++i )
264 QString
crs = wmsCrsList.at( i );
265 if ( !
crs.isEmpty() )
267 crsList.append(
crs );
271 if ( crsList.isEmpty() )
273 QStringList valueList = project.
readListEntry( QStringLiteral(
"WMSEpsgList" ), QStringLiteral(
"/" ), QStringList() );
275 for (
int i = 0; i < valueList.size(); ++i )
277 int epsgNr = valueList.at( i ).toInt( &conversionOk );
280 crsList.append( QStringLiteral(
"EPSG:%1" ).arg( epsgNr ) );
284 if ( crsList.isEmpty() )
287 QString projectCrsId = project.
crs().
authid();
288 crsList.append( projectCrsId );
289 if ( projectCrsId.compare( QLatin1String(
"EPSG:4326" ), Qt::CaseInsensitive ) != 0 )
291 crsList.append( QStringLiteral(
"EPSG:%1" ).arg( 4326 ) );
293 if ( projectCrsId.compare( QLatin1String(
"EPSG:3857" ), Qt::CaseInsensitive ) != 0 )
295 crsList.append( QStringLiteral(
"EPSG:%1" ).arg( 3857 ) );
303 return project.
readEntry( QStringLiteral(
"WMSUrl" ), QStringLiteral(
"/" ),
"" );
308 return project.
readEntry( QStringLiteral(
"WMSRootName" ), QStringLiteral(
"/" ),
"" );
313 return project.
readListEntry( QStringLiteral(
"WMSRestrictedLayers" ), QStringLiteral(
"/" ), QStringList() );
319 QStringList values = project.
readListEntry( QStringLiteral(
"WMSExtent" ), QStringLiteral(
"/" ), QStringList(), &ok );
320 if ( !ok || values.size() != 4 )
325 double xmin = values[ 0 ].toDouble();
326 double ymin = values[ 1 ].toDouble();
327 double xmax = values[ 2 ].toDouble();
328 double ymax = values[ 3 ].toDouble();
334 return project.
readEntry( QStringLiteral(
"WFSUrl" ), QStringLiteral(
"/" ),
"" );
339 return project.
readListEntry( QStringLiteral(
"WFSLayers" ), QStringLiteral(
"/" ) );
344 return project.
readNumEntry( QStringLiteral(
"WFSLayersPrecision" ),
"/" + layerId, 6 );
349 return project.
readListEntry( QStringLiteral(
"WFSTLayers" ), QStringLiteral(
"Update" ) );
354 return project.
readListEntry( QStringLiteral(
"WFSTLayers" ), QStringLiteral(
"Insert" ) );
359 return project.
readListEntry( QStringLiteral(
"WFSTLayers" ), QStringLiteral(
"Delete" ) );
364 return project.
readEntry( QStringLiteral(
"WCSUrl" ), QStringLiteral(
"/" ),
"" );
369 return project.
readListEntry( QStringLiteral(
"WCSLayers" ), QStringLiteral(
"/" ) );
374 return project.
readEntry( QStringLiteral(
"WMTSUrl" ), QStringLiteral(
"/" ),
"" );
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
bool isActive() const
Returns whether the property is currently active.
SERVER_EXPORT int wmsMaxAtlasFeatures(const QgsProject &project)
Returns the maximum number of atlas features which can be printed in a request.
A store for object properties.
SERVER_EXPORT QString wmsFeatureInfoDocumentElementNs(const QgsProject &project)
Returns the document element namespace for XML GetFeatureInfo request.
SERVER_EXPORT QString wcsServiceUrl(const QgsProject &project)
Returns the WCS service url defined in a QGIS project.
SERVER_EXPORT bool wmsFeatureInfoSegmentizeWktGeometry(const QgsProject &project)
Returns if the geometry has to be segmentize in GetFeatureInfo request.
SERVER_EXPORT QString wmtsServiceUrl(const QgsProject &project)
Returns the WMTS service url defined in a QGIS project.
SERVER_EXPORT double ceilWithPrecision(double number, int places)
Returns a double greater than number to the specified number of places.
const QgsCoordinateReferenceSystem & crs
SERVER_EXPORT QHash< QString, QString > wmsFeatureInfoLayerAliasMap(const QgsProject &project)
Returns the mapping between layer name and wms layer name for GetFeatureInfo request.
QgsPropertyCollection dataDefinedServerProperties() const
Returns the data defined properties used for overrides in user defined server parameters.
SERVER_EXPORT QString wmsServiceUrl(const QgsProject &project)
Returns the WMS service url defined in a QGIS project.
SERVER_EXPORT QStringList wfstInsertLayerIds(const QgsProject &project)
Returns the Layer ids list defined in a QGIS project as published as WFS-T with insert capabilities.
QString readEntry(const QString &scope, const QString &key, const QString &def=QString(), bool *ok=nullptr) const
bool readBoolEntry(const QString &scope, const QString &key, bool def=false, bool *ok=nullptr) const
SERVER_EXPORT QStringList wcsLayerIds(const QgsProject &project)
Returns the Layer ids list defined in a QGIS project as published in WCS.
SERVER_EXPORT QString owsServiceContactPosition(const QgsProject &project)
Returns the owsService contact position defined in project.
QgsProperty property(int key) const override
Returns a matching property from the collection, if one exists.
QString expressionString() const
Returns the expression used for the property value.
SERVER_EXPORT QString wmsInspireTemporalReference(const QgsProject &project)
Returns the Inspire temporal reference.
SERVER_EXPORT QString wfsServiceUrl(const QgsProject &project)
Returns the WFS service url defined in a QGIS project.
SERVER_EXPORT QString wmsFeatureInfoDocumentElement(const QgsProject &project)
Returns the document element name for XML GetFeatureInfo request.
SERVER_EXPORT bool wmsUseLayerIds(const QgsProject &project)
Returns if layer ids are used as name in WMS.
SERVER_EXPORT QString wmsInspireMetadataUrl(const QgsProject &project)
Returns the Inspire metadata URL.
SERVER_EXPORT QString wmsInspireLanguage(const QgsProject &project)
Returns the Inspire language.
SERVER_EXPORT QStringList wmsOutputCrsList(const QgsProject &project)
Returns the WMS output CRS list.
SERVER_EXPORT int wmsFeatureInfoPrecision(const QgsProject &project)
Returns the geometry precision for GetFeatureInfo request.
SERVER_EXPORT int wmsMaxHeight(const QgsProject &project)
Returns the maximum height for WMS images defined in a QGIS project.
SERVER_EXPORT QStringList wfsLayerIds(const QgsProject &project)
Returns the Layer ids list defined in a QGIS project as published in WFS.
SERVER_EXPORT QStringList wfstDeleteLayerIds(const QgsProject &project)
Returns the Layer ids list defined in a QGIS project as published as WFS-T with delete capabilities.
SERVER_EXPORT QString owsServiceContactOrganization(const QgsProject &project)
Returns the owsService contact organization defined in project.
SERVER_EXPORT int wmsTileBuffer(const QgsProject &project)
Returns the tile buffer in pixels for WMS images defined in a QGIS project.
SERVER_EXPORT QString owsServiceContactMail(const QgsProject &project)
Returns the owsService contact mail defined in project.
SERVER_EXPORT bool wmsInspireActivate(const QgsProject &project)
Returns if Inspire is activated.
SERVER_EXPORT double floorWithPrecision(double number, int places)
Returns a double less than number to the specified number of places.
SERVER_EXPORT QStringList wmsRestrictedLayers(const QgsProject &project)
Returns the restricted layer name list.
QString authid() const
Returns the authority identifier for the CRS.
SERVER_EXPORT bool wmsFeatureInfoAddWktGeometry(const QgsProject &project)
Returns if the geometry is displayed as Well Known Text in GetFeatureInfo request.
QString valueAsString(const QgsExpressionContext &context, const QString &defaultString=QString(), bool *ok=nullptr) const
Calculates the current value of the property and interprets it as a string.
SERVER_EXPORT QgsRectangle wmsExtent(const QgsProject &project)
Returns the WMS Extent restriction.
double readDoubleEntry(const QString &scope, const QString &key, double def=0, bool *ok=nullptr) const
SERVER_EXPORT int wfsLayerPrecision(const QgsProject &project, const QString &layerId)
Returns the Layer precision defined in a QGIS project for the WFS GetFeature.
SERVER_EXPORT int wmsMaxWidth(const QgsProject &project)
Returns the maximum width for WMS images defined in a QGIS project.
SERVER_EXPORT QString wmsFeatureInfoSchema(const QgsProject &project)
Returns the schema URL for XML GetFeatureInfo request.
SERVER_EXPORT bool owsServiceCapabilities(const QgsProject &project)
Returns if owsService capabilities are enabled.
SERVER_EXPORT QString wmsRootName(const QgsProject &project)
Returns the WMS root layer name defined in a QGIS project.
SERVER_EXPORT double wmsDefaultMapUnitsPerMm(const QgsProject &project)
Returns the default number of map units per millimeters in case of the scale is not given.
SERVER_EXPORT int wmsImageQuality(const QgsProject &project)
Returns the quality for WMS images defined in a QGIS project.
SERVER_EXPORT QString owsServiceAccessConstraints(const QgsProject &project)
Returns the owsService access constraints defined in project.
SERVER_EXPORT QString owsServiceContactPhone(const QgsProject &project)
Returns the owsService contact phone defined in project.
QgsExpressionContext createExpressionContext() const override
This method needs to be reimplemented in all classes which implement this interface and return an exp...
SERVER_EXPORT QStringList wmsRestrictedComposers(const QgsProject &project)
Returns the restricted composer list.
SERVER_EXPORT bool wmsInfoFormatSia2045(const QgsProject &project)
Returns if the info format is SIA20145.
QStringList readListEntry(const QString &scope, const QString &key, const QStringList &def=QStringList(), bool *ok=nullptr) const
Key value accessors.
SERVER_EXPORT QStringList wfstUpdateLayerIds(const QgsProject &project)
Returns the Layer ids list defined in a QGIS project as published as WFS-T with update capabilities.
SERVER_EXPORT QString wmsInspireMetadataDate(const QgsProject &project)
Returns the Inspire metadata date.
SERVER_EXPORT QStringList owsServiceKeywords(const QgsProject &project)
Returns the owsService keywords defined in project.
QgsCoordinateReferenceSystem crs
SERVER_EXPORT QString owsServiceFees(const QgsProject &project)
Returns the owsService fees defined in project.
SERVER_EXPORT QString owsServiceContactPerson(const QgsProject &project)
Returns the owsService contact person defined in project.
int readNumEntry(const QString &scope, const QString &key, int def=0, bool *ok=nullptr) const
SERVER_EXPORT QString wmsInspireMetadataUrlType(const QgsProject &project)
Returns the Inspire metadata URL type.
SERVER_EXPORT QString owsServiceTitle(const QgsProject &project)
Returns the owsService title defined in project.
SERVER_EXPORT QString owsServiceOnlineResource(const QgsProject &project)
Returns the owsService online resource defined in project.
SERVER_EXPORT QString owsServiceAbstract(const QgsProject &project)
Returns the owsService abstract defined in project.