Skip to content

Commit

Permalink
fix(ServerWFS): Remove version from OGC urn
Browse files Browse the repository at this point in the history
in order to stay consistent with the whole application (GeoJSON export
for instance) where version is not set. Version is optionnal (see
https://www.ogc.org/about-ogc/policies/ogc-urn-policy/).
  • Loading branch information
troopa81 committed Aug 14, 2024
1 parent dc68f03 commit 1c90384
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/core/proj/qgscoordinatereferencesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1633,7 +1633,7 @@ QString QgsCoordinateReferenceSystem::toOgcUrn() const
if ( parts.length() == 2 )
{
if ( parts[0] == QLatin1String( "EPSG" ) )
return QStringLiteral( "urn:ogc:def:crs:EPSG:0:%1" ).arg( parts[1] );
return QStringLiteral( "urn:ogc:def:crs:EPSG::%1" ).arg( parts[1] );
else if ( parts[0] == QLatin1String( "OGC" ) )
{
return QStringLiteral( "urn:ogc:def:crs:OGC:1.3:%1" ).arg( parts[1] );
Expand Down
6 changes: 3 additions & 3 deletions tests/src/python/test_qgsserver_wfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +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")
self.assertEqual(jdata['crs']['properties']['name'], "urn:ogc:def:crs:EPSG::3857")

query_string = "?" + "&".join(["%s=%s" % i for i in list({
"SERVICE": "WFS",
Expand Down Expand Up @@ -836,7 +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")
self.assertEqual(jdata['crs']['properties']['name'], "urn:ogc:def:crs:EPSG::32632")

query_string = "?" + "&".join(["%s=%s" % i for i in list({
"SERVICE": "WFS",
Expand All @@ -854,7 +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")
self.assertEqual(jdata['crs']['properties']['name'], "urn:ogc:def:crs:EPSG::3857")

def test_insert_srsName(self):
"""Test srsName is respected when insering"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Content-Type: application/json; charset=utf-8
"crs":
{
"properties": {
"name": "urn:ogc:def:crs:EPSG:0:3857"
"name": "urn:ogc:def:crs:EPSG::3857"
},
"type": "name"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Content-Type: application/json; charset=utf-8
"crs":
{
"properties": {
"name": "urn:ogc:def:crs:EPSG:0:3857"
"name": "urn:ogc:def:crs:EPSG::3857"
},
"type": "name"
},
Expand Down
2 changes: 1 addition & 1 deletion tests/testdata/qgis_server/wms_getfeatureinfo_geojson.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Content-Type: application/geo+json; charset=utf-8
"crs":
{
"properties": {
"name": "urn:ogc:def:crs:EPSG:0:3857"
"name": "urn:ogc:def:crs:EPSG::3857"
},
"type": "name"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Content-Type: application/json; charset=utf-8
"crs":
{
"properties": {
"name": "urn:ogc:def:crs:EPSG:0:3857"
"name": "urn:ogc:def:crs:EPSG::3857"
},
"type": "name"
},
Expand Down
2 changes: 1 addition & 1 deletion tests/testdata/qgis_server/wms_getfeatureinfo_json.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Content-Type: application/json; charset=utf-8
"crs":
{
"properties": {
"name": "urn:ogc:def:crs:EPSG:0:3857"
"name": "urn:ogc:def:crs:EPSG::3857"
},
"type": "name"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Content-Type: application/json; charset=utf-8
"crs":
{
"properties": {
"name": "urn:ogc:def:crs:EPSG:0:3857"
"name": "urn:ogc:def:crs:EPSG::3857"
},
"type": "name"
},
Expand Down

0 comments on commit 1c90384

Please sign in to comment.