From d3b3479ad758eacaddf3a3e4fb60a41ab5508fce Mon Sep 17 00:00:00 2001 From: Olivier Courtin Date: Tue, 27 Apr 2010 13:58:41 +0000 Subject: [PATCH] Fix wrong OGC URN in GeoJson and GML output. Cf #507 git-svn-id: http://svn.osgeo.org/postgis/trunk@5572 b70326c6-7e19-0410-871a-916f4a2858ee --- doc/reference_output.xml | 6 +++--- liblwgeom/cunit/cu_out_gml.c | 8 ++++---- postgis/lwgeom_export.c | 4 ++-- regress/out_geography_expected | 28 ++++++++++++++-------------- regress/out_geometry_expected | 12 ++++++------ 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/doc/reference_output.xml b/doc/reference_output.xml index 7a0980206..429791a1e 100644 --- a/doc/reference_output.xml +++ b/doc/reference_output.xml @@ -326,7 +326,7 @@ CIRCULARSTRING(220268 150415 1,220227 150505 2,220227 150406 3) - 4: GeoJSON Long CRS (e.g urn:ogc:def:crs:EPSG:4326) + 4: GeoJSON Long CRS (e.g urn:ogc:def:crs:EPSG::4326) @@ -471,7 +471,7 @@ st_asgeojson - 1: GML Long CRS (e.g urn:ogc:def:crs:EPSG:4326) + 1: GML Long CRS (e.g urn:ogc:def:crs:EPSG::4326) @@ -502,7 +502,7 @@ namespace prefix or no prefix (if empty). If null or omitted 'gml' prefix is use 6.34535 5.23423]]> + 6.34535 5.23423]]> diff --git a/liblwgeom/cunit/cu_out_gml.c b/liblwgeom/cunit/cu_out_gml.c index ba24a3b05..671405268 100644 --- a/liblwgeom/cunit/cu_out_gml.c +++ b/liblwgeom/cunit/cu_out_gml.c @@ -278,14 +278,14 @@ static void out_gml_test_geodetic(void) /* GML3 - Geodetic Point */ do_gml3_test( "POINT(0 1)", - "1 0", - "urn:ogc:def:crs:EPSG:4326", 0, 1); + "1 0", + "urn:ogc:def:crs:EPSG::4326", 0, 1); /* GML3 - 3D Geodetic Point */ do_gml3_test( "POINT(0 1 2)", - "1 0 2", - "urn:ogc:def:crs:EPSG:4326", 0, 1); + "1 0 2", + "urn:ogc:def:crs:EPSG::4326", 0, 1); } diff --git a/postgis/lwgeom_export.c b/postgis/lwgeom_export.c index b0becf8e9..ccaca578a 100644 --- a/postgis/lwgeom_export.c +++ b/postgis/lwgeom_export.c @@ -32,7 +32,7 @@ Datum LWGEOM_asSVG(PG_FUNCTION_ARGS); * Require valid spatial_ref_sys table entry * * Could return SRS as short one (i.e EPSG:4326) - * or as long one: (i.e urn:ogc:def:crs:EPSG:4326) + * or as long one: (i.e urn:ogc:def:crs:EPSG::4326) */ char * getSRSbySRID(int SRID, bool short_crs) { @@ -51,7 +51,7 @@ char * getSRSbySRID(int SRID, bool short_crs) sprintf(query, "SELECT auth_name||':'||auth_srid \ FROM spatial_ref_sys WHERE srid='%d'", SRID); else - sprintf(query, "SELECT 'urn:ogc:def:crs:'||auth_name||':'||auth_srid \ + sprintf(query, "SELECT 'urn:ogc:def:crs:'||auth_name||'::'||auth_srid \ FROM spatial_ref_sys WHERE srid='%d'", SRID); err = SPI_exec(query, 1); diff --git a/regress/out_geography_expected b/regress/out_geography_expected index b8cfe38d4..0b8fa9a8f 100644 --- a/regress/out_geography_expected +++ b/regress/out_geography_expected @@ -6,11 +6,11 @@ gml_version_02|1 11,1 -gml_option_02|1 1 +gml_option_02|1 1 gml_deegree_01|1,2 -gml_deegree_02|1,2 +gml_deegree_02|1,2 gml_deegree_03|1 2 -gml_deegree_04|2 1 +gml_deegree_04|2 1 gml_prefix_01|1,2 gml_prefix_02|1 2 gml_prefix_03|1,2 @@ -41,14 +41,14 @@ ERROR: Only GeoJSON 1 is supported ERROR: Only GeoJSON 1 is supported geojson_crs_01|{"type":"Point","crs":{"type":"name","properties":{"name":"EPSG:4326"}},"coordinates":[1,1]} geojson_crs_02|{"type":"Point","crs":{"type":"name","properties":{"name":"EPSG:4326"}},"coordinates":[1,1]} -geojson_crs_03|{"type":"Point","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG:4326"}},"coordinates":[1,1]} -geojson_crs_04|{"type":"Point","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG:4326"}},"coordinates":[1,1]} +geojson_crs_03|{"type":"Point","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG::4326"}},"coordinates":[1,1]} +geojson_crs_04|{"type":"Point","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG::4326"}},"coordinates":[1,1]} ERROR: Only SRID SRID_DEFAULT is currently supported in geography. ERROR: Only SRID SRID_DEFAULT is currently supported in geography. geojson_bbox_01|{"type":"LineString","coordinates":[[1,1],[2,2],[3,3],[4,4]]} geojson_bbox_02|{"type":"LineString","bbox":[1,1,4,4],"coordinates":[[1,1],[2,2],[3,3],[4,4]]} geojson_bbox_03|{"type":"LineString","crs":{"type":"name","properties":{"name":"EPSG:4326"}},"bbox":[1,1,4,4],"coordinates":[[1,1],[2,2],[3,3],[4,4]]} -geojson_bbox_04|{"type":"LineString","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG:4326"}},"bbox":[1,1,4,4],"coordinates":[[1,1],[2,2],[3,3],[4,4]]} +geojson_bbox_04|{"type":"LineString","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG::4326"}},"bbox":[1,1,4,4],"coordinates":[[1,1],[2,2],[3,3],[4,4]]} geojson_options_01|{"type":"LineString","coordinates":[[1,1],[2,2],[3,3],[4,4]]} geojson_options_02|{"type":"LineString","coordinates":[[1,1],[2,2],[3,3],[4,4]]} geojson_options_03|{"type":"LineString","bbox":[1,1,4,4],"coordinates":[[1,1],[2,2],[3,3],[4,4]]} @@ -57,11 +57,11 @@ geojson_options_05|{"type":"LineString","crs":{"type":"name","properties":{"name geojson_options_06|{"type":"LineString","crs":{"type":"name","properties":{"name":"EPSG:4326"}},"coordinates":[[1,1],[2,2],[3,3],[4,4]]} geojson_options_07|{"type":"LineString","crs":{"type":"name","properties":{"name":"EPSG:4326"}},"bbox":[1,1,4,4],"coordinates":[[1,1],[2,2],[3,3],[4,4]]} geojson_options_08|{"type":"LineString","crs":{"type":"name","properties":{"name":"EPSG:4326"}},"bbox":[1,1,4,4],"coordinates":[[1,1],[2,2],[3,3],[4,4]]} -geojson_options_09|{"type":"LineString","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG:4326"}},"coordinates":[[1,1],[2,2],[3,3],[4,4]]} -geojson_options_10|{"type":"LineString","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG:4326"}},"coordinates":[[1,1],[2,2],[3,3],[4,4]]} -geojson_options_11|{"type":"LineString","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG:4326"}},"bbox":[1,1,4,4],"coordinates":[[1,1],[2,2],[3,3],[4,4]]} -geojson_options_12|{"type":"LineString","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG:4326"}},"bbox":[1,1,4,4],"coordinates":[[1,1],[2,2],[3,3],[4,4]]} -geojson_options_13|{"type":"LineString","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG:4326"}},"coordinates":[[1,1],[2,2],[3,3],[4,4]]} -geojson_options_14|{"type":"LineString","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG:4326"}},"coordinates":[[1,1],[2,2],[3,3],[4,4]]} -geojson_options_15|{"type":"LineString","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG:4326"}},"bbox":[1,1,4,4],"coordinates":[[1,1],[2,2],[3,3],[4,4]]} -geojson_options_16|{"type":"LineString","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG:4326"}},"bbox":[1,1,4,4],"coordinates":[[1,1],[2,2],[3,3],[4,4]]} +geojson_options_09|{"type":"LineString","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG::4326"}},"coordinates":[[1,1],[2,2],[3,3],[4,4]]} +geojson_options_10|{"type":"LineString","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG::4326"}},"coordinates":[[1,1],[2,2],[3,3],[4,4]]} +geojson_options_11|{"type":"LineString","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG::4326"}},"bbox":[1,1,4,4],"coordinates":[[1,1],[2,2],[3,3],[4,4]]} +geojson_options_12|{"type":"LineString","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG::4326"}},"bbox":[1,1,4,4],"coordinates":[[1,1],[2,2],[3,3],[4,4]]} +geojson_options_13|{"type":"LineString","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG::4326"}},"coordinates":[[1,1],[2,2],[3,3],[4,4]]} +geojson_options_14|{"type":"LineString","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG::4326"}},"coordinates":[[1,1],[2,2],[3,3],[4,4]]} +geojson_options_15|{"type":"LineString","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG::4326"}},"bbox":[1,1,4,4],"coordinates":[[1,1],[2,2],[3,3],[4,4]]} +geojson_options_16|{"type":"LineString","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG::4326"}},"bbox":[1,1,4,4],"coordinates":[[1,1],[2,2],[3,3],[4,4]]} diff --git a/regress/out_geometry_expected b/regress/out_geometry_expected index c9be1c42e..917afa696 100644 --- a/regress/out_geometry_expected +++ b/regress/out_geometry_expected @@ -6,7 +6,7 @@ gml_version_02|1 11,1 -gml_option_02|1 1 +gml_option_02|1 1 gml_deegree_01|1 2 gml_deegree_02|1,2 gml_deegree_03|2 1 @@ -43,7 +43,7 @@ ERROR: Only GeoJSON 1 is supported ERROR: Only GeoJSON 1 is supported geojson_crs_01|{"type":"Point","crs":{"type":"name","properties":{"name":"EPSG:4326"}},"coordinates":[1,1]} geojson_crs_02|{"type":"Point","coordinates":[1,1]} -geojson_crs_03|{"type":"Point","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG:4326"}},"coordinates":[1,1]} +geojson_crs_03|{"type":"Point","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG::4326"}},"coordinates":[1,1]} geojson_crs_04|{"type":"Point","coordinates":[1,1]} ERROR: SRID 1 unknown in spatial_ref_sys table ERROR: SRID 1 unknown in spatial_ref_sys table @@ -60,10 +60,10 @@ geojson_options_06|{"type":"LineString","crs":{"type":"name","properties":{"name geojson_options_07|{"type":"LineString","bbox":[1,1,4,4],"coordinates":[[1,1],[2,2],[3,3],[4,4]]} geojson_options_08|{"type":"LineString","crs":{"type":"name","properties":{"name":"EPSG:4326"}},"bbox":[1,1,4,4],"coordinates":[[1,1],[2,2],[3,3],[4,4]]} geojson_options_09|{"type":"LineString","coordinates":[[1,1],[2,2],[3,3],[4,4]]} -geojson_options_10|{"type":"LineString","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG:4326"}},"coordinates":[[1,1],[2,2],[3,3],[4,4]]} +geojson_options_10|{"type":"LineString","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG::4326"}},"coordinates":[[1,1],[2,2],[3,3],[4,4]]} geojson_options_11|{"type":"LineString","bbox":[1,1,4,4],"coordinates":[[1,1],[2,2],[3,3],[4,4]]} -geojson_options_12|{"type":"LineString","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG:4326"}},"bbox":[1,1,4,4],"coordinates":[[1,1],[2,2],[3,3],[4,4]]} +geojson_options_12|{"type":"LineString","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG::4326"}},"bbox":[1,1,4,4],"coordinates":[[1,1],[2,2],[3,3],[4,4]]} geojson_options_13|{"type":"LineString","coordinates":[[1,1],[2,2],[3,3],[4,4]]} -geojson_options_14|{"type":"LineString","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG:4326"}},"coordinates":[[1,1],[2,2],[3,3],[4,4]]} +geojson_options_14|{"type":"LineString","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG::4326"}},"coordinates":[[1,1],[2,2],[3,3],[4,4]]} geojson_options_15|{"type":"LineString","bbox":[1,1,4,4],"coordinates":[[1,1],[2,2],[3,3],[4,4]]} -geojson_options_16|{"type":"LineString","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG:4326"}},"bbox":[1,1,4,4],"coordinates":[[1,1],[2,2],[3,3],[4,4]]} +geojson_options_16|{"type":"LineString","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG::4326"}},"bbox":[1,1,4,4],"coordinates":[[1,1],[2,2],[3,3],[4,4]]} -- 2.40.0