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 return project.
readEntry( QStringLiteral(
"WMSOnlineResource" ), QStringLiteral(
"/" ) );
73 return project.
readEntry( QStringLiteral(
"WMSContactOrganization" ), QStringLiteral(
"/" ) );
78 return project.
readEntry( QStringLiteral(
"WMSContactPosition" ), QStringLiteral(
"/" ) );
83 return project.
readEntry( QStringLiteral(
"WMSContactPerson" ), QStringLiteral(
"/" ) );
88 return project.
readEntry( QStringLiteral(
"WMSContactMail" ), QStringLiteral(
"/" ) );
93 return project.
readEntry( QStringLiteral(
"WMSContactPhone" ), QStringLiteral(
"/" ) );
98 return project.
readEntry( QStringLiteral(
"WMSFees" ), QStringLiteral(
"/" ) );
103 return project.
readEntry( QStringLiteral(
"WMSAccessConstraints" ), QStringLiteral(
"/" ) );
108 return project.
readNumEntry( QStringLiteral(
"WMSMaxWidth" ), QStringLiteral(
"/" ), -1 );
113 return project.
readNumEntry( QStringLiteral(
"WMSMaxHeight" ), QStringLiteral(
"/" ), -1 );
118 return project.
readBoolEntry( QStringLiteral(
"WMSUseLayerIDs" ), QStringLiteral(
"/" ),
false );
123 return project.
readNumEntry( QStringLiteral(
"WMSImageQuality" ), QStringLiteral(
"/" ), -1 );
128 return project.
readDoubleEntry( QStringLiteral(
"WMSDefaultMapUnitsPerMm" ), QStringLiteral(
"/" ), 1 );
133 QString sia2045 = project.
readEntry( QStringLiteral(
"WMSInfoFormatSIA2045" ), QStringLiteral(
"/" ),
"" );
135 return sia2045.compare( QLatin1String(
"enabled" ), Qt::CaseInsensitive ) == 0
136 || sia2045.compare( QLatin1String(
"true" ), Qt::CaseInsensitive ) == 0;
141 QString wktGeom = project.
readEntry( QStringLiteral(
"WMSAddWktGeometry" ), QStringLiteral(
"/" ),
"" );
143 return wktGeom.compare( QLatin1String(
"enabled" ), Qt::CaseInsensitive ) == 0
144 || wktGeom.compare( QLatin1String(
"true" ), Qt::CaseInsensitive ) == 0;
149 QString segmGeom = project.
readEntry( QStringLiteral(
"WMSSegmentizeFeatureInfoGeometry" ), QStringLiteral(
"/" ),
"" );
151 return segmGeom.compare( QLatin1String(
"enabled" ), Qt::CaseInsensitive ) == 0
152 || segmGeom.compare( QLatin1String(
"true" ), Qt::CaseInsensitive ) == 0;
157 return project.
readNumEntry( QStringLiteral(
"WMSPrecision" ), QStringLiteral(
"/" ), 6 );
162 return project.
readEntry( QStringLiteral(
"WMSFeatureInfoDocumentElement" ), QStringLiteral(
"/" ),
"" );
167 return project.
readEntry( QStringLiteral(
"WMSFeatureInfoDocumentElementNS" ), QStringLiteral(
"/" ),
"" );
172 return project.
readEntry( QStringLiteral(
"WMSFeatureInfoSchema" ), QStringLiteral(
"/" ),
"" );
177 QHash<QString, QString> aliasMap;
180 QStringList aliasLayerStringList = project.
readListEntry( QStringLiteral(
"WMSFeatureInfoAliasLayers" ), QStringLiteral(
"/value" ), QStringList() );
181 if ( aliasLayerStringList.isEmpty() )
187 QStringList layerAliasStringList = project.
readListEntry( QStringLiteral(
"WMSFeatureInfoLayerAliases" ), QStringLiteral(
"/value" ), QStringList() );
188 if ( layerAliasStringList.isEmpty() )
193 int nMapEntries = std::min( aliasLayerStringList.size(), layerAliasStringList.size() );
194 for (
int i = 0; i < nMapEntries; ++i )
196 aliasMap.insert( aliasLayerStringList.at( i ), layerAliasStringList.at( i ) );
204 return project.
readBoolEntry( QStringLiteral(
"WMSInspire" ), QStringLiteral(
"/activated" ) );
209 return project.
readEntry( QStringLiteral(
"WMSInspire" ), QStringLiteral(
"/language" ) );
214 return project.
readEntry( QStringLiteral(
"WMSInspire" ), QStringLiteral(
"/metadataUrl" ) );
219 return project.
readEntry( QStringLiteral(
"WMSInspire" ), QStringLiteral(
"/metadataUrlType" ) );
224 return project.
readEntry( QStringLiteral(
"WMSInspire" ), QStringLiteral(
"/temporalReference" ) );
229 return project.
readEntry( QStringLiteral(
"WMSInspire" ), QStringLiteral(
"/metadataDate" ) );
234 return project.
readListEntry( QStringLiteral(
"WMSRestrictedComposers" ), QStringLiteral(
"/" ), QStringList() );
240 QStringList wmsCrsList = project.
readListEntry( QStringLiteral(
"WMSCrsList" ), QStringLiteral(
"/" ), QStringList() );
241 if ( !wmsCrsList.isEmpty() )
243 for (
int i = 0; i < wmsCrsList.size(); ++i )
245 QString
crs = wmsCrsList.at( i );
246 if ( !crs.isEmpty() )
248 crsList.append( crs );
252 if ( crsList.isEmpty() )
254 QStringList valueList = project.
readListEntry( QStringLiteral(
"WMSEpsgList" ), QStringLiteral(
"/" ), QStringList() );
256 for (
int i = 0; i < valueList.size(); ++i )
258 int epsgNr = valueList.at( i ).toInt( &conversionOk );
261 crsList.append( QStringLiteral(
"EPSG:%1" ).arg( epsgNr ) );
265 if ( crsList.isEmpty() )
268 QString projectCrsId = project.
crs().
authid();
269 crsList.append( projectCrsId );
270 if ( projectCrsId.compare( QLatin1String(
"EPSG:4326" ), Qt::CaseInsensitive ) != 0 )
272 crsList.append( QStringLiteral(
"EPSG:%1" ).arg( 4326 ) );
274 if ( projectCrsId.compare( QLatin1String(
"EPSG:3857" ), Qt::CaseInsensitive ) != 0 )
276 crsList.append( QStringLiteral(
"EPSG:%1" ).arg( 3857 ) );
284 return project.
readEntry( QStringLiteral(
"WMSUrl" ), QStringLiteral(
"/" ),
"" );
289 return project.
readEntry( QStringLiteral(
"WMSRootName" ), QStringLiteral(
"/" ),
"" );
294 return project.
readListEntry( QStringLiteral(
"WMSRestrictedLayers" ), QStringLiteral(
"/" ), QStringList() );
300 QStringList values = project.
readListEntry( QStringLiteral(
"WMSExtent" ), QStringLiteral(
"/" ), QStringList(), &ok );
301 if ( !ok || values.size() != 4 )
306 double xmin = values[ 0 ].toDouble();
307 double ymin = values[ 1 ].toDouble();
308 double xmax = values[ 2 ].toDouble();
309 double ymax = values[ 3 ].toDouble();
315 return project.
readEntry( QStringLiteral(
"WFSUrl" ), QStringLiteral(
"/" ),
"" );
320 return project.
readListEntry( QStringLiteral(
"WFSLayers" ), QStringLiteral(
"/" ) );
325 return project.
readNumEntry( QStringLiteral(
"WFSLayersPrecision" ),
"/" + layerId, 6 );
330 return project.
readListEntry( QStringLiteral(
"WFSTLayers" ), QStringLiteral(
"Update" ) );
335 return project.
readListEntry( QStringLiteral(
"WFSTLayers" ), QStringLiteral(
"Insert" ) );
340 return project.
readListEntry( QStringLiteral(
"WFSTLayers" ), QStringLiteral(
"Delete" ) );
345 return project.
readEntry( QStringLiteral(
"WCSUrl" ), QStringLiteral(
"/" ),
"" );
350 return project.
readListEntry( QStringLiteral(
"WCSLayers" ), QStringLiteral(
"/" ) );
355 return project.
readEntry( QStringLiteral(
"WMTSUrl" ), QStringLiteral(
"/" ),
"" );
SERVER_EXPORT QString wmsInspireMetadataUrl(const QgsProject &project)
Returns the Inspire metadata URL.
SERVER_EXPORT QStringList wmsOutputCrsList(const QgsProject &project)
Returns the WMS output CRS list.
A rectangle specified with double values.
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 int wmsMaxWidth(const QgsProject &project)
Returns the maximum width for WMS images defined in a QGIS project.
SERVER_EXPORT bool owsServiceCapabilities(const QgsProject &project)
Returns if owsService capabilities are enabled.
SERVER_EXPORT QString wmsServiceUrl(const QgsProject &project)
Returns the WMS service url defined in a QGIS project.
SERVER_EXPORT QString owsServiceContactPosition(const QgsProject &project)
Returns the owsService contact position defined in project.
SERVER_EXPORT QString owsServiceContactPerson(const QgsProject &project)
Returns the owsService contact person defined in project.
SERVER_EXPORT QStringList owsServiceKeywords(const QgsProject &project)
Returns the owsService keywords defined in 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 QString owsServiceAbstract(const QgsProject &project)
Returns the owsService abstract defined in project.
SERVER_EXPORT QString wmsFeatureInfoDocumentElement(const QgsProject &project)
Returns the document element name for XML GetFeatureInfo request.
QStringList readListEntry(const QString &scope, const QString &key, const QStringList &def=QStringList(), bool *ok=nullptr) const
Key value accessors.
SERVER_EXPORT QHash< QString, QString > wmsFeatureInfoLayerAliasMap(const QgsProject &project)
Returns the mapping between layer name and wms layer name for GetFeatureInfo request.
SERVER_EXPORT bool wmsInfoFormatSia2045(const QgsProject &project)
Returns if the info format is SIA20145.
const QgsCoordinateReferenceSystem & crs
SERVER_EXPORT QString wmsInspireMetadataDate(const QgsProject &project)
Returns the Inspire metadata date.
QString readEntry(const QString &scope, const QString &key, const QString &def=QString(), bool *ok=nullptr) const
SERVER_EXPORT QString wmtsServiceUrl(const QgsProject &project)
Returns the WMTS service url defined in a QGIS project.
SERVER_EXPORT bool wmsFeatureInfoAddWktGeometry(const QgsProject &project)
Returns if the geometry is displayed as Well Known Text in GetFeatureInfo request.
SERVER_EXPORT QString wmsFeatureInfoDocumentElementNs(const QgsProject &project)
Returns the document element namespace for XML GetFeatureInfo request.
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 QStringList wmsRestrictedComposers(const QgsProject &project)
Returns the restricted composer list.
SERVER_EXPORT double floorWithPrecision(double number, int places)
Returns a double less than number to the specified number of places.
QgsCoordinateReferenceSystem crs
SERVER_EXPORT QStringList wcsLayerIds(const QgsProject &project)
Returns the Layer ids list defined in a QGIS project as published in WCS.
SERVER_EXPORT bool wmsFeatureInfoSegmentizeWktGeometry(const QgsProject &project)
Returns if the geometry has to be segmentize in GetFeatureInfo request.
SERVER_EXPORT bool wmsInspireActivate(const QgsProject &project)
Returns if Inspire is activated.
SERVER_EXPORT QString wmsInspireTemporalReference(const QgsProject &project)
Returns the Inspire temporal reference.
Reads and writes project states.
SERVER_EXPORT QString wmsInspireLanguage(const QgsProject &project)
Returns the Inspire language.
SERVER_EXPORT QString owsServiceFees(const QgsProject &project)
Returns the owsService fees defined in project.
SERVER_EXPORT double ceilWithPrecision(double number, int places)
Returns a double greater than number to the specified number of places.
SERVER_EXPORT QString owsServiceAccessConstraints(const QgsProject &project)
Returns the owsService access constraints defined in project.
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 QString owsServiceOnlineResource(const QgsProject &project)
Returns the owsService online resource defined in project.
int readNumEntry(const QString &scope, const QString &key, int def=0, bool *ok=nullptr) const
SERVER_EXPORT QString owsServiceContactOrganization(const QgsProject &project)
Returns the owsService contact organization defined in project.
double readDoubleEntry(const QString &scope, const QString &key, double def=0, bool *ok=nullptr) const
SERVER_EXPORT QString wcsServiceUrl(const QgsProject &project)
Returns the WCS service url defined in a QGIS project.
SERVER_EXPORT int wmsFeatureInfoPrecision(const QgsProject &project)
Returns the geometry precision for GetFeatureInfo request.
SERVER_EXPORT QgsRectangle wmsExtent(const QgsProject &project)
Returns the WMS Extent restriction.
SERVER_EXPORT QStringList wfsLayerIds(const QgsProject &project)
Returns the Layer ids list defined in a QGIS project as published in WFS.
SERVER_EXPORT QString wmsInspireMetadataUrlType(const QgsProject &project)
Returns the Inspire metadata URL type.
QString authid() const
Returns the authority identifier for the CRS.
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...
bool readBoolEntry(const QString &scope, const QString &key, bool def=false, bool *ok=nullptr) const
SERVER_EXPORT QString owsServiceContactMail(const QgsProject &project)
Returns the owsService contact mail defined in project.
SERVER_EXPORT QString wmsFeatureInfoSchema(const QgsProject &project)
Returns the schema URL for XML GetFeatureInfo request.
SERVER_EXPORT QStringList wmsRestrictedLayers(const QgsProject &project)
Returns the restricted layer name list.
SERVER_EXPORT QString wmsRootName(const QgsProject &project)
Returns the WMS root layer name defined in a QGIS project.
SERVER_EXPORT QString wfsServiceUrl(const QgsProject &project)
Returns the WFS service url defined in a QGIS project.
SERVER_EXPORT QString owsServiceTitle(const QgsProject &project)
Returns the owsService title defined in project.
SERVER_EXPORT int wmsImageQuality(const QgsProject &project)
Returns the quality for WMS images defined in a QGIS project.
SERVER_EXPORT QString owsServiceContactPhone(const QgsProject &project)
Returns the owsService contact phone defined in project.
SERVER_EXPORT int wmsMaxHeight(const QgsProject &project)
Returns the maximum height for WMS images defined in a QGIS project.
SERVER_EXPORT bool wmsUseLayerIds(const QgsProject &project)
Returns if layer ids are used as name in WMS.