From 101a5cccf714ccdd3be3eba88ffb1cbf82ad9c1b Mon Sep 17 00:00:00 2001 From: Julien Cabieces Date: Tue, 23 Jan 2024 18:48:27 +0100 Subject: [PATCH 1/5] [Feat] Add crs information in WMS GetFeatureInfo output --- .../proj/qgscoordinatereferencesystem.sip.in | 8 +++++++ .../core/auto_generated/qgsjsonutils.sip.in | 1 + .../proj/qgscoordinatereferencesystem.sip.in | 8 +++++++ .../core/auto_generated/qgsjsonutils.sip.in | 1 + .../proj/qgscoordinatereferencesystem.cpp | 24 +++++++++++++++++++ src/core/proj/qgscoordinatereferencesystem.h | 8 +++++++ src/core/qgsjsonutils.cpp | 14 +++++++++++ src/core/qgsjsonutils.h | 9 +++++++ src/server/services/wms/qgswmsrenderer.cpp | 6 +++-- src/server/services/wms/qgswmsrenderer.h | 2 +- .../test_qgsserver_wms_getfeatureinfo.py | 24 +++++++++++++++++++ .../wms_getfeatureinfo_alias_json.txt | 7 ++++++ ..._getfeatureinfo_exclude_attribute_json.txt | 7 ++++++ .../wms_getfeatureinfo_geojson.txt | 7 ++++++ ...wms_getfeatureinfo_geometry_CRS84_json.txt | 24 +++++++++++++++++++ .../wms_getfeatureinfo_geometry_json.txt | 7 ++++++ .../qgis_server/wms_getfeatureinfo_json.txt | 7 ++++++ .../wms_getfeatureinfo_multiple_json.txt | 7 ++++++ 18 files changed, 168 insertions(+), 3 deletions(-) create mode 100644 tests/testdata/qgis_server/wms_getfeatureinfo_geometry_CRS84_json.txt diff --git a/python/PyQt6/core/auto_generated/proj/qgscoordinatereferencesystem.sip.in b/python/PyQt6/core/auto_generated/proj/qgscoordinatereferencesystem.sip.in index d3f26e89b41e..6635d83da796 100644 --- a/python/PyQt6/core/auto_generated/proj/qgscoordinatereferencesystem.sip.in +++ b/python/PyQt6/core/auto_generated/proj/qgscoordinatereferencesystem.sip.in @@ -972,6 +972,14 @@ projection in the WGS 84 CRS. Returns the crs as OGC URI (format: http://www.opengis.net/def/crs/OGC/1.3/CRS84) Returns an empty string on failure. +.. versionadded:: 3.30 +%End + + QString toOgcUrn() const; +%Docstring +Returns the crs as OGC URN (format: urn:ogc:def:crs:OGC:1.3:CRS84) +Returns an empty string on failure. + .. versionadded:: 3.30 %End diff --git a/python/PyQt6/core/auto_generated/qgsjsonutils.sip.in b/python/PyQt6/core/auto_generated/qgsjsonutils.sip.in index 2b9322784515..799f629dfdd9 100644 --- a/python/PyQt6/core/auto_generated/qgsjsonutils.sip.in +++ b/python/PyQt6/core/auto_generated/qgsjsonutils.sip.in @@ -363,6 +363,7 @@ Returns a null geometry if the geometry could not be parsed. + }; /************************************************************************ diff --git a/python/core/auto_generated/proj/qgscoordinatereferencesystem.sip.in b/python/core/auto_generated/proj/qgscoordinatereferencesystem.sip.in index a35a7f51df42..8cd4b270aa54 100644 --- a/python/core/auto_generated/proj/qgscoordinatereferencesystem.sip.in +++ b/python/core/auto_generated/proj/qgscoordinatereferencesystem.sip.in @@ -972,6 +972,14 @@ projection in the WGS 84 CRS. Returns the crs as OGC URI (format: http://www.opengis.net/def/crs/OGC/1.3/CRS84) Returns an empty string on failure. +.. versionadded:: 3.30 +%End + + QString toOgcUrn() const; +%Docstring +Returns the crs as OGC URN (format: urn:ogc:def:crs:OGC:1.3:CRS84) +Returns an empty string on failure. + .. versionadded:: 3.30 %End diff --git a/python/core/auto_generated/qgsjsonutils.sip.in b/python/core/auto_generated/qgsjsonutils.sip.in index c45c146701cf..81b58724bc53 100644 --- a/python/core/auto_generated/qgsjsonutils.sip.in +++ b/python/core/auto_generated/qgsjsonutils.sip.in @@ -363,6 +363,7 @@ Returns a null geometry if the geometry could not be parsed. + }; /************************************************************************ diff --git a/src/core/proj/qgscoordinatereferencesystem.cpp b/src/core/proj/qgscoordinatereferencesystem.cpp index 67d4853ac9c8..5bf8a33b6824 100644 --- a/src/core/proj/qgscoordinatereferencesystem.cpp +++ b/src/core/proj/qgscoordinatereferencesystem.cpp @@ -1600,6 +1600,30 @@ QString QgsCoordinateReferenceSystem::toOgcUri() const return QString(); } +QString QgsCoordinateReferenceSystem::toOgcUrn() const +{ + const auto parts { authid().split( ':' ) }; + if ( parts.length() == 2 ) + { + if ( parts[0] == QLatin1String( "EPSG" ) ) + return QStringLiteral( "urn:ogc:def:crs:EPSG:0:%1" ).arg( parts[1] ); + else if ( parts[0] == QLatin1String( "OGC" ) ) + { + return QStringLiteral( "urn:ogc:def:crs:OGC:1.3:%1" ).arg( parts[1] ); + } + else + { + QgsMessageLog::logMessage( QStringLiteral( "Error converting published CRS to URN %1: (not OGC or EPSG)" ).arg( authid() ), QStringLiteral( "CRS" ), Qgis::MessageLevel::Critical ); + } + } + else + { + QgsMessageLog::logMessage( QStringLiteral( "Error converting published CRS to URN: %1" ).arg( authid() ), QStringLiteral( "CRS" ), Qgis::MessageLevel::Critical ); + } + return QString(); +} + + void QgsCoordinateReferenceSystem::updateDefinition() { if ( !d->mIsValid ) diff --git a/src/core/proj/qgscoordinatereferencesystem.h b/src/core/proj/qgscoordinatereferencesystem.h index 194474841f04..0f6bb77e4fb5 100644 --- a/src/core/proj/qgscoordinatereferencesystem.h +++ b/src/core/proj/qgscoordinatereferencesystem.h @@ -895,6 +895,14 @@ class CORE_EXPORT QgsCoordinateReferenceSystem */ QString toOgcUri() const; + /** + * Returns the crs as OGC URN (format: urn:ogc:def:crs:OGC:1.3:CRS84) + * Returns an empty string on failure. + * + * \since QGIS 3.30 + */ + QString toOgcUrn() const; + // Mutators ----------------------------------- /** diff --git a/src/core/qgsjsonutils.cpp b/src/core/qgsjsonutils.cpp index 644ba640e4b9..0585b2666d38 100644 --- a/src/core/qgsjsonutils.cpp +++ b/src/core/qgsjsonutils.cpp @@ -245,6 +245,9 @@ json QgsJsonExporter::exportFeaturesToJsonObject( const QgsFeatureList &features { "type", "FeatureCollection" }, { "features", json::array() } }; + + QgsJsonUtils::addCrsInfo( data, mDestinationCrs ); + for ( const QgsFeature &feature : std::as_const( features ) ) { data["features"].push_back( exportFeatureToJsonObject( feature ) ); @@ -912,3 +915,14 @@ json QgsJsonUtils::exportAttributesToJsonObject( const QgsFeature &feature, QgsV } return attrs; } + +void QgsJsonUtils::addCrsInfo( json &value, const QgsCoordinateReferenceSystem &crs ) +{ + // When user request EPSG:4326 we return a compliant CRS84 lon/lat GeoJSON + // so no need to add CRS information + if ( crs.authid() == "OGC:CRS84" || crs.authid() == "EPSG:4326" ) + return; + + value["crs"]["type"] = "name"; + value["crs"]["properties"]["name"] = crs.toOgcUrn().toStdString(); +} diff --git a/src/core/qgsjsonutils.h b/src/core/qgsjsonutils.h index 3e6aa0a7dbc6..5decc9fe1fc6 100644 --- a/src/core/qgsjsonutils.h +++ b/src/core/qgsjsonutils.h @@ -423,6 +423,15 @@ class CORE_EXPORT QgsJsonUtils */ static QVariant jsonToVariant( const json &value ) SIP_SKIP; + /** + * Add \a crs information entry in \a json object regarding old GeoJSON specification format + * if it differs from OGC:CRS84 or EPSG:4326. + * According to new specification RFC 7946, coordinate reference system for all GeoJSON coordinates + * is assumed to be OGC:CRS84 but when user specifically request a different CRS, this method + * allow to add this information in the JSON output + */ + static void addCrsInfo( json &value, const QgsCoordinateReferenceSystem &crs ) SIP_SKIP; + }; #endif // QGSJSONUTILS_H diff --git a/src/server/services/wms/qgswmsrenderer.cpp b/src/server/services/wms/qgswmsrenderer.cpp index 197c22f19200..8c832e4ec393 100644 --- a/src/server/services/wms/qgswmsrenderer.cpp +++ b/src/server/services/wms/qgswmsrenderer.cpp @@ -1316,7 +1316,7 @@ namespace QgsWms else if ( infoFormat == QgsWmsParameters::Format::HTML ) ba = convertFeatureInfoToHtml( result ); else if ( infoFormat == QgsWmsParameters::Format::JSON ) - ba = convertFeatureInfoToJson( layers, result ); + ba = convertFeatureInfoToJson( layers, result, mapSettings.destinationCrs() ); else ba = result.toByteArray(); @@ -2813,7 +2813,7 @@ namespace QgsWms return featureInfoString.toUtf8(); } - QByteArray QgsRenderer::convertFeatureInfoToJson( const QList &layers, const QDomDocument &doc ) const + QByteArray QgsRenderer::convertFeatureInfoToJson( const QList &layers, const QDomDocument &doc, const QgsCoordinateReferenceSystem &destCRS ) const { json json { @@ -2915,6 +2915,8 @@ namespace QgsWms exporter.setIncludeGeometry( withGeometry ); exporter.setTransformGeometries( false ); + QgsJsonUtils::addCrsInfo( json, destCRS ); + for ( const auto &feature : std::as_const( features ) ) { const QString id = QStringLiteral( "%1.%2" ).arg( layerName ).arg( fidMap.value( feature.id() ) ); diff --git a/src/server/services/wms/qgswmsrenderer.h b/src/server/services/wms/qgswmsrenderer.h index 9efbd00e7cfb..1ad582d8069a 100644 --- a/src/server/services/wms/qgswmsrenderer.h +++ b/src/server/services/wms/qgswmsrenderer.h @@ -323,7 +323,7 @@ namespace QgsWms QByteArray convertFeatureInfoToText( const QDomDocument &doc ) const; //! Converts a feature info xml document to json - QByteArray convertFeatureInfoToJson( const QList &layers, const QDomDocument &doc ) const; + QByteArray convertFeatureInfoToJson( const QList &layers, const QDomDocument &doc, const QgsCoordinateReferenceSystem &destCRS ) const; QDomElement createFeatureGML( const QgsFeature *feat, diff --git a/tests/src/python/test_qgsserver_wms_getfeatureinfo.py b/tests/src/python/test_qgsserver_wms_getfeatureinfo.py index 2416bec2f3be..0d634f74b2b8 100644 --- a/tests/src/python/test_qgsserver_wms_getfeatureinfo.py +++ b/tests/src/python/test_qgsserver_wms_getfeatureinfo.py @@ -615,6 +615,30 @@ def testGetFeatureInfoJSON(self): 'wms_getfeatureinfo_raster_json', normalizeJson=True) + # simple test with geometry with underlying layer in 4326 and CRS is EPSG:4326 + self.wms_request_compare('GetFeatureInfo', + '&layers=testlayer%20%C3%A8%C3%A9&styles=&' + + 'info_format=application%2Fjson&transparent=true&' + + 'width=600&height=400&srs=EPSG:4326&' + + 'bbox=44.9014173,8.2034387,44.9015094,8.2036094&' + + 'query_layers=testlayer2&X=203&Y=116&' + + 'with_geometry=true', + 'wms_getfeatureinfo_geometry_CRS84_json', + 'test_project.qgs', + normalizeJson=True) + + # simple test with geometry with underlying layer in 4326 and CRS is CRS84 + self.wms_request_compare('GetFeatureInfo', + '&layers=testlayer%20%C3%A8%C3%A9&styles=&' + + 'info_format=application%2Fjson&transparent=true&' + + 'width=600&height=400&srs=OGC:CRS84&' + + 'bbox=8.2034387,44.9014173,8.2036094,44.9015094&' + + 'query_layers=testlayer2&X=203&Y=116&' + + 'with_geometry=true', + 'wms_getfeatureinfo_geometry_CRS84_json', + 'test_project.qgs', + normalizeJson=True) + def testGetFeatureInfoGroupedLayers(self): """Test that we can get feature info from the top and group layers""" diff --git a/tests/testdata/qgis_server/wms_getfeatureinfo_alias_json.txt b/tests/testdata/qgis_server/wms_getfeatureinfo_alias_json.txt index c6e43c20d560..445b318673b2 100644 --- a/tests/testdata/qgis_server/wms_getfeatureinfo_alias_json.txt +++ b/tests/testdata/qgis_server/wms_getfeatureinfo_alias_json.txt @@ -2,6 +2,13 @@ Content-Type: application/json; charset=utf-8 { + "crs": + { + "properties": { + "name": "urn:ogc:def:crs:EPSG:0:3857" + }, + "type": "name" + }, "features": [ { "geometry": null, diff --git a/tests/testdata/qgis_server/wms_getfeatureinfo_exclude_attribute_json.txt b/tests/testdata/qgis_server/wms_getfeatureinfo_exclude_attribute_json.txt index 1535a9702c4f..d8984c9030cc 100644 --- a/tests/testdata/qgis_server/wms_getfeatureinfo_exclude_attribute_json.txt +++ b/tests/testdata/qgis_server/wms_getfeatureinfo_exclude_attribute_json.txt @@ -2,6 +2,13 @@ Content-Type: application/json; charset=utf-8 { + "crs": + { + "properties": { + "name": "urn:ogc:def:crs:EPSG:0:3857" + }, + "type": "name" + }, "features": [ { "geometry": null, diff --git a/tests/testdata/qgis_server/wms_getfeatureinfo_geojson.txt b/tests/testdata/qgis_server/wms_getfeatureinfo_geojson.txt index b910446e47c8..3b9f8db9af7c 100644 --- a/tests/testdata/qgis_server/wms_getfeatureinfo_geojson.txt +++ b/tests/testdata/qgis_server/wms_getfeatureinfo_geojson.txt @@ -2,6 +2,13 @@ Content-Type: application/geo+json; charset=utf-8 { + "crs": + { + "properties": { + "name": "urn:ogc:def:crs:EPSG:0:3857" + }, + "type": "name" + }, "features": [ { "geometry": null, diff --git a/tests/testdata/qgis_server/wms_getfeatureinfo_geometry_CRS84_json.txt b/tests/testdata/qgis_server/wms_getfeatureinfo_geometry_CRS84_json.txt new file mode 100644 index 000000000000..1125b3ee9e3d --- /dev/null +++ b/tests/testdata/qgis_server/wms_getfeatureinfo_geometry_CRS84_json.txt @@ -0,0 +1,24 @@ +***** +Content-Type: application/json; charset=utf-8 + +{ + "features": [ + { + "geometry": { + "coordinates": [ + 8.2035, + 44.9015 + ], + "type": "Point" + }, + "id": "testlayer2.0", + "properties": { + "id": 1, + "name": "one", + "utf8nameè": "one èé" + }, + "type": "Feature" + } + ], + "type": "FeatureCollection" +} diff --git a/tests/testdata/qgis_server/wms_getfeatureinfo_geometry_json.txt b/tests/testdata/qgis_server/wms_getfeatureinfo_geometry_json.txt index f248b083459c..5204b6fe23f0 100644 --- a/tests/testdata/qgis_server/wms_getfeatureinfo_geometry_json.txt +++ b/tests/testdata/qgis_server/wms_getfeatureinfo_geometry_json.txt @@ -2,6 +2,13 @@ Content-Type: application/json; charset=utf-8 { + "crs": + { + "properties": { + "name": "urn:ogc:def:crs:EPSG:0:3857" + }, + "type": "name" + }, "features": [ { "geometry": { diff --git a/tests/testdata/qgis_server/wms_getfeatureinfo_json.txt b/tests/testdata/qgis_server/wms_getfeatureinfo_json.txt index 4ba7c4ca5db5..41cc8910893c 100644 --- a/tests/testdata/qgis_server/wms_getfeatureinfo_json.txt +++ b/tests/testdata/qgis_server/wms_getfeatureinfo_json.txt @@ -2,6 +2,13 @@ Content-Type: application/json; charset=utf-8 { + "crs": + { + "properties": { + "name": "urn:ogc:def:crs:EPSG:0:3857" + }, + "type": "name" + }, "features": [ { "geometry": null, diff --git a/tests/testdata/qgis_server/wms_getfeatureinfo_multiple_json.txt b/tests/testdata/qgis_server/wms_getfeatureinfo_multiple_json.txt index b761b71e1d83..a8709da01519 100644 --- a/tests/testdata/qgis_server/wms_getfeatureinfo_multiple_json.txt +++ b/tests/testdata/qgis_server/wms_getfeatureinfo_multiple_json.txt @@ -2,6 +2,13 @@ Content-Type: application/json; charset=utf-8 { + "crs": + { + "properties": { + "name": "urn:ogc:def:crs:EPSG:0:3857" + }, + "type": "name" + }, "features": [ { "geometry": null, From 533a7170ecd652f207c3984ce74d9f67164bbd51 Mon Sep 17 00:00:00 2001 From: Julien Cabieces Date: Wed, 6 Mar 2024 17:19:48 +0100 Subject: [PATCH 2/5] update version --- .../auto_generated/proj/qgscoordinatereferencesystem.sip.in | 2 +- .../auto_generated/proj/qgscoordinatereferencesystem.sip.in | 2 +- src/core/proj/qgscoordinatereferencesystem.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python/PyQt6/core/auto_generated/proj/qgscoordinatereferencesystem.sip.in b/python/PyQt6/core/auto_generated/proj/qgscoordinatereferencesystem.sip.in index 6635d83da796..e15df9182a22 100644 --- a/python/PyQt6/core/auto_generated/proj/qgscoordinatereferencesystem.sip.in +++ b/python/PyQt6/core/auto_generated/proj/qgscoordinatereferencesystem.sip.in @@ -980,7 +980,7 @@ Returns an empty string on failure. Returns the crs as OGC URN (format: urn:ogc:def:crs:OGC:1.3:CRS84) Returns an empty string on failure. -.. versionadded:: 3.30 +.. versionadded:: 3.38 %End diff --git a/python/core/auto_generated/proj/qgscoordinatereferencesystem.sip.in b/python/core/auto_generated/proj/qgscoordinatereferencesystem.sip.in index 8cd4b270aa54..11edc46b55bd 100644 --- a/python/core/auto_generated/proj/qgscoordinatereferencesystem.sip.in +++ b/python/core/auto_generated/proj/qgscoordinatereferencesystem.sip.in @@ -980,7 +980,7 @@ Returns an empty string on failure. Returns the crs as OGC URN (format: urn:ogc:def:crs:OGC:1.3:CRS84) Returns an empty string on failure. -.. versionadded:: 3.30 +.. versionadded:: 3.38 %End diff --git a/src/core/proj/qgscoordinatereferencesystem.h b/src/core/proj/qgscoordinatereferencesystem.h index 0f6bb77e4fb5..aa0dc4694511 100644 --- a/src/core/proj/qgscoordinatereferencesystem.h +++ b/src/core/proj/qgscoordinatereferencesystem.h @@ -899,7 +899,7 @@ class CORE_EXPORT QgsCoordinateReferenceSystem * Returns the crs as OGC URN (format: urn:ogc:def:crs:OGC:1.3:CRS84) * Returns an empty string on failure. * - * \since QGIS 3.30 + * \since QGIS 3.38 */ QString toOgcUrn() const; From f7d5febf33faa6e63fffcc985487152b99004cd2 Mon Sep 17 00:00:00 2001 From: Julien Cabieces Date: Wed, 6 Mar 2024 19:05:13 +0100 Subject: [PATCH 3/5] [Server][WFS] Add CRS info to GeoJSON output when requested CRS is not WGS84 --- src/server/services/wfs/qgswfsgetfeature.cpp | 15 +++++++++++++++ tests/src/python/test_qgsserver_wfs.py | 4 ++++ 2 files changed, 19 insertions(+) diff --git a/src/server/services/wfs/qgswfsgetfeature.cpp b/src/server/services/wfs/qgswfsgetfeature.cpp index a484dd1d3bab..7d7149779fa4 100644 --- a/src/server/services/wfs/qgswfsgetfeature.cpp +++ b/src/server/services/wfs/qgswfsgetfeature.cpp @@ -1174,6 +1174,21 @@ namespace QgsWfs fcString = QStringLiteral( "{\"type\": \"FeatureCollection\",\n" ); fcString += " \"bbox\": [ " + qgsDoubleToString( rect->xMinimum(), prec ) + ", " + qgsDoubleToString( rect->yMinimum(), prec ) + ", " + qgsDoubleToString( rect->xMaximum(), prec ) + ", " + qgsDoubleToString( rect->yMaximum(), prec ) + "],\n"; + + const QString srsName {request.serverParameters().value( QStringLiteral( "SRSNAME" ) )}; + const QgsCoordinateReferenceSystem destinationCrs { srsName.isEmpty( ) ? QStringLiteral( "EPSG:4326" ) : srsName }; + if ( ! destinationCrs.isValid() ) + { + throw QgsRequestNotWellFormedException( QStringLiteral( "srsName error: '%1' is not valid." ).arg( srsName ) ); + } + + json value; + QgsJsonUtils::addCrsInfo( value, destinationCrs ); + for ( auto it : value.items() ) + { + fcString += " \"" + QString::fromStdString( it.key() ) + "\": " + QString::fromStdString( it.value().dump() ) + ",\n"; + } + fcString += QLatin1String( " \"features\": [\n" ); response.write( fcString.toUtf8() ); } diff --git a/tests/src/python/test_qgsserver_wfs.py b/tests/src/python/test_qgsserver_wfs.py index f97be0916b7d..ec5ffcfcb948 100644 --- a/tests/src/python/test_qgsserver_wfs.py +++ b/tests/src/python/test_qgsserver_wfs.py @@ -787,6 +787,7 @@ def test_getFeatureFeatureJsonCrs(self): jdata['features'][0]['geometry'] jdata['features'][0]['geometry']['coordinates'] self.assertEqual(jdata['features'][0]['geometry']['coordinates'], [807305, 5592878]) + self.assertEqual(jdata['crs']['properties']['name'], "urn:ogc:def:crs:EPSG:0:3857") query_string = "?" + "&".join(["%s=%s" % i for i in list({ "SERVICE": "WFS", @@ -803,6 +804,7 @@ def test_getFeatureFeatureJsonCrs(self): jdata['features'][0]['geometry'] jdata['features'][0]['geometry']['coordinates'] self.assertEqual([int(i) for i in jdata['features'][0]['geometry']['coordinates']], [7, 44]) + self.assertFalse('crs' in jdata) query_string = "?" + "&".join(["%s=%s" % i for i in list({ "SERVICE": "WFS", @@ -834,6 +836,7 @@ def test_getFeatureFeatureJsonCrs(self): jdata['features'][0]['geometry'] jdata['features'][0]['geometry']['coordinates'] self.assertEqual([int(i) for i in jdata['features'][0]['geometry']['coordinates']], [361806, 4964192]) + self.assertEqual(jdata['crs']['properties']['name'], "urn:ogc:def:crs:EPSG:0:32632") query_string = "?" + "&".join(["%s=%s" % i for i in list({ "SERVICE": "WFS", @@ -851,6 +854,7 @@ def test_getFeatureFeatureJsonCrs(self): jdata['features'][0]['geometry'] jdata['features'][0]['geometry']['coordinates'] self.assertEqual([int(i) for i in jdata['features'][0]['geometry']['coordinates']], [812191, 5589555]) + self.assertEqual(jdata['crs']['properties']['name'], "urn:ogc:def:crs:EPSG:0:3857") def test_insert_srsName(self): """Test srsName is respected when insering""" From d45c8fe443f61cfd9ac70330cfe70912bdda4f9e Mon Sep 17 00:00:00 2001 From: Julien Cabieces Date: Wed, 6 Mar 2024 19:10:29 +0100 Subject: [PATCH 4/5] fix spellcheck --- src/core/qgsjsonutils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/qgsjsonutils.h b/src/core/qgsjsonutils.h index 5decc9fe1fc6..6e1b793e8df2 100644 --- a/src/core/qgsjsonutils.h +++ b/src/core/qgsjsonutils.h @@ -428,7 +428,7 @@ class CORE_EXPORT QgsJsonUtils * if it differs from OGC:CRS84 or EPSG:4326. * According to new specification RFC 7946, coordinate reference system for all GeoJSON coordinates * is assumed to be OGC:CRS84 but when user specifically request a different CRS, this method - * allow to add this information in the JSON output + * adds this information in the JSON output */ static void addCrsInfo( json &value, const QgsCoordinateReferenceSystem &crs ) SIP_SKIP; From 713b5be010e9dab287f310f9728193b25bd8a394 Mon Sep 17 00:00:00 2001 From: Julien Cabieces Date: Wed, 27 Mar 2024 15:32:27 +0100 Subject: [PATCH 5/5] constify Co-authored-by: Paul Blottiere --- src/server/services/wfs/qgswfsgetfeature.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/services/wfs/qgswfsgetfeature.cpp b/src/server/services/wfs/qgswfsgetfeature.cpp index 7d7149779fa4..9f8763794019 100644 --- a/src/server/services/wfs/qgswfsgetfeature.cpp +++ b/src/server/services/wfs/qgswfsgetfeature.cpp @@ -1184,7 +1184,7 @@ namespace QgsWfs json value; QgsJsonUtils::addCrsInfo( value, destinationCrs ); - for ( auto it : value.items() ) + for ( const auto &it : value.items() ) { fcString += " \"" + QString::fromStdString( it.key() ) + "\": " + QString::fromStdString( it.value().dump() ) + ",\n"; }