-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
qgswfsgetfeature: Properly handle ogc urns in post requests
There are 2 different parameters to check to define the output crs: - the request parameter (`SRSNAME` from the request) - the query crs parameter For a `GET` request, if `SRSNAME` is set, both parameters are set and equal. For a `POST` request, only the query parameter is set if defined. In `writeGetFeature()`, the `outputCrs` correctly takes into account the query parameter. However, this is not the case for the output srs name (`srsName`) which only takes into account the query CRS as an auth id. Therefore, the output srsName will always be defined as an authid even if the parameter is an ogc urn. This issue is fixed by first computing the output srs name (`outputSrsName`) by taking into account the query and the query parameters. Then, this name is used to compute `outputCrs`.
- Loading branch information
Showing
3 changed files
with
92 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
tests/testdata/qgis_server/wfs_getfeature_srsname_post_1_1_0_urn.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
Content-Type: text/xml; subtype=gml/3.1.1; charset=utf-8 | ||
|
||
<wfs:FeatureCollection xmlns:wfs="http://www.opengis.net/wfs" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" xmlns:ows="http://www.opengis.net/ows" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:qgs="http://www.qgis.org/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd http://www.qgis.org/gml ?"> | ||
<gml:boundedBy> | ||
<gml:Envelope srsName="EPSG:4326"> | ||
<gml:lowerCorner>8 44</gml:lowerCorner> | ||
<gml:upperCorner>9 45</gml:upperCorner> | ||
</gml:Envelope> | ||
</gml:boundedBy> | ||
<gml:featureMember> | ||
<qgs:testlayer gml:id="testlayer.0"> | ||
<gml:boundedBy> | ||
<gml:Envelope srsName="urn:ogc:def:crs:EPSG::3857"> | ||
<gml:lowerCorner>913209.03579284 5606025.23730414</gml:lowerCorner> | ||
<gml:upperCorner>913209.03579284 5606025.23730414</gml:upperCorner> | ||
</gml:Envelope> | ||
</gml:boundedBy> | ||
<qgs:geometry> | ||
<Point xmlns="http://www.opengis.net/gml" srsName="urn:ogc:def:crs:EPSG::3857"> | ||
<pos xmlns="http://www.opengis.net/gml" srsDimension="2">913209.03579284 5606025.23730414</pos> | ||
</Point> | ||
</qgs:geometry> | ||
<qgs:id>1</qgs:id> | ||
<qgs:name>one</qgs:name> | ||
<qgs:utf8nameè>one èé</qgs:utf8nameè> | ||
</qgs:testlayer> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<qgs:testlayer gml:id="testlayer.1"> | ||
<gml:boundedBy> | ||
<gml:Envelope srsName="urn:ogc:def:crs:EPSG::3857"> | ||
<gml:lowerCorner>913214.67407005 5606017.87425818</gml:lowerCorner> | ||
<gml:upperCorner>913214.67407005 5606017.87425818</gml:upperCorner> | ||
</gml:Envelope> | ||
</gml:boundedBy> | ||
<qgs:geometry> | ||
<Point xmlns="http://www.opengis.net/gml" srsName="urn:ogc:def:crs:EPSG::3857"> | ||
<pos xmlns="http://www.opengis.net/gml" srsDimension="2">913214.67407005 5606017.87425818</pos> | ||
</Point> | ||
</qgs:geometry> | ||
<qgs:id>2</qgs:id> | ||
<qgs:name>two</qgs:name> | ||
<qgs:utf8nameè>two àò</qgs:utf8nameè> | ||
</qgs:testlayer> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<qgs:testlayer gml:id="testlayer.2"> | ||
<gml:boundedBy> | ||
<gml:Envelope srsName="urn:ogc:def:crs:EPSG::3857"> | ||
<gml:lowerCorner>913204.91280263 5606011.45647302</gml:lowerCorner> | ||
<gml:upperCorner>913204.91280263 5606011.45647302</gml:upperCorner> | ||
</gml:Envelope> | ||
</gml:boundedBy> | ||
<qgs:geometry> | ||
<Point xmlns="http://www.opengis.net/gml" srsName="urn:ogc:def:crs:EPSG::3857"> | ||
<pos xmlns="http://www.opengis.net/gml" srsDimension="2">913204.91280263 5606011.45647302</pos> | ||
</Point> | ||
</qgs:geometry> | ||
<qgs:id>3</qgs:id> | ||
<qgs:name>three</qgs:name> | ||
<qgs:utf8nameè>three èé↓</qgs:utf8nameè> | ||
</qgs:testlayer> | ||
</gml:featureMember> | ||
</wfs:FeatureCollection> |