Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix server OAPIF crs transformation on items #32596

Merged
merged 3 commits into from
Nov 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/server/services/wfs3/qgswfs3handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,7 @@ void QgsWfs3CollectionsItemsHandler::handleRequest( const QgsServerApiContext &c
QgsJsonExporter exporter { mapLayer };
exporter.setAttributes( featureRequest.subsetOfAttributes() );
exporter.setAttributeDisplayName( true );
exporter.setSourceCrs( mapLayer->crs() );
exporter.setTransformGeometries( false );
QgsFeatureList featureList;
QgsFeatureIterator features { mapLayer->getFeatures( featureRequest ) };
QgsFeature feat;
Expand Down
16 changes: 16 additions & 0 deletions tests/src/python/test_qgsserver_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,22 @@ def test_wfs3_collection_items_crs(self):
request = QgsBufferServerRequest('http://server.qgis.org/wfs3/collections/testlayer%20èé/items?crs={}'.format(encoded_crs))
self.compareApi(request, project, 'test_wfs3_collections_items_testlayer_èé_crs_3857.json')

def test_wfs3_collection_items_as_areas_crs_4326(self):
"""Test WFS3 API items with CRS"""
project = QgsProject()
project.read(unitTestDataPath('qgis_server') + '/test_project_wms_grouped_nested_layers.qgs')
encoded_crs = parse.quote('http://www.opengis.net/def/crs/EPSG/9.6.2/4326', safe='')
request = QgsBufferServerRequest('http://server.qgis.org/wfs3/collections/as-areas-short-name/items?crs={}'.format(encoded_crs))
self.compareApi(request, project, 'test_wfs3_collections_items_as-areas-short-name_4326.json')

def test_wfs3_collection_items_as_areas_crs_3857(self):
"""Test WFS3 API items with CRS"""
project = QgsProject()
project.read(unitTestDataPath('qgis_server') + '/test_project_wms_grouped_nested_layers.qgs')
encoded_crs = parse.quote('http://www.opengis.net/def/crs/EPSG/9.6.2/3857', safe='')
request = QgsBufferServerRequest('http://server.qgis.org/wfs3/collections/as-areas-short-name/items?crs={}'.format(encoded_crs))
self.compareApi(request, project, 'test_wfs3_collections_items_as-areas-short-name_3857.json')

def test_invalid_args(self):
"""Test wrong args"""
project = QgsProject()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ Content-Type: application/json
"type": "text/html"
}
],
"timeStamp": "2019-10-16T13:53:56Z",
"timeStamp": "2019-11-02T15:56:20Z",
"title": "A test vector layer èé"
}
Loading