From 8e78cacdc7314f7296d7d26e44628da068fca6de Mon Sep 17 00:00:00 2001 From: Olivier Courtin Date: Tue, 22 May 2012 16:02:05 +0000 Subject: [PATCH] Fix wrong SQL prototype, wrong PostGIS version number, and use NULL as default value rather than empty string, related to #1823 git-svn-id: http://svn.osgeo.org/postgis/trunk@9785 b70326c6-7e19-0410-871a-916f4a2858ee --- doc/reference_output.xml | 4 +++- postgis/geography_inout.c | 2 +- postgis/lwgeom_export.c | 2 +- postgis/postgis.sql.in.c | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/doc/reference_output.xml b/doc/reference_output.xml index 31c5b4813..2f09edbb1 100644 --- a/doc/reference_output.xml +++ b/doc/reference_output.xml @@ -365,6 +365,7 @@ st_asgeojson + text ST_AsGML @@ -448,7 +450,7 @@ namespace prefix or no prefix (if empty). If null or omitted 'gml' prefix is use Availability: 1.5.0 geography support was introduced. Enhanced: 2.0.0 prefix support was introduced. Option 4 for GML3 was introduced to allow using LineString instead of Curve tag for lines. GML3 Support for Polyhedral surfaces and TINS was introduced. Option 32 was introduced to output the box. Changed: 2.0.0 use default named args - Availability: 2.0.1 id support was introduced, for GML 3. + Availability: 2.1.0 id support was introduced, for GML 3. Only version 3+ of ST_AsGML supports Polyhedral Surfaces and TINS. &Z_support; diff --git a/postgis/geography_inout.c b/postgis/geography_inout.c index c0d9ff2a1..f8cb5811f 100644 --- a/postgis/geography_inout.c +++ b/postgis/geography_inout.c @@ -214,7 +214,7 @@ Datum geography_as_gml(PG_FUNCTION_ARGS) const char *prefix = default_prefix; char *prefix_buf = ""; text *prefix_text, *id_text = NULL; - const char *id=""; + const char *id=NULL; char *id_buf; diff --git a/postgis/lwgeom_export.c b/postgis/lwgeom_export.c index 0624030cb..e0a551e98 100644 --- a/postgis/lwgeom_export.c +++ b/postgis/lwgeom_export.c @@ -174,7 +174,7 @@ Datum LWGEOM_asGML(PG_FUNCTION_ARGS) int precision = OUT_MAX_DOUBLE_PRECISION; static const char* default_prefix = "gml:"; /* default prefix */ const char* prefix = default_prefix; - const char* gml_id = ""; + const char* gml_id = NULL; char *prefix_buf, *gml_id_buf; text *prefix_text, *gml_id_text; diff --git a/postgis/postgis.sql.in.c b/postgis/postgis.sql.in.c index b36708db8..7c397a87c 100644 --- a/postgis/postgis.sql.in.c +++ b/postgis/postgis.sql.in.c @@ -3427,7 +3427,7 @@ CREATE OR REPLACE FUNCTION _ST_AsGML(int4, geometry, int4, int4, text, text) -- ST_AsGML (geom, precision, option) / version=2 -- Availability: 1.4.0 -- Changed: 2.0.0 to have default args -CREATE OR REPLACE FUNCTION ST_AsGML(geom geometry, maxdecimaldigits int4 DEFAULT 15, options int4 DEFAULT) +CREATE OR REPLACE FUNCTION ST_AsGML(geom geometry, maxdecimaldigits int4 DEFAULT 15, options int4 DEFAULT 0) RETURNS TEXT AS $$ SELECT _ST_AsGML(2, $1, $2, $3, null, null); $$ LANGUAGE 'sql' IMMUTABLE STRICT; @@ -3438,7 +3438,7 @@ CREATE OR REPLACE FUNCTION ST_AsGML(geom geometry, maxdecimaldigits int4 DEFAULT -- Availability: 2.0.0 -- Changed: 2.0.0 to use default and named args -- ST_AsGML(version, geom, precision, option, prefix, id) --- Availability: 2.0.1 +-- Availability: 2.1.0 CREATE OR REPLACE FUNCTION ST_AsGML(version int4, geom geometry, maxdecimaldigits int4 DEFAULT 15, options int4 DEFAULT 0, nprefix text DEFAULT null, id text DEFAULT null) RETURNS TEXT AS $$ SELECT _ST_AsGML($1, $2, $3, $4, $5, $6); $$ -- 2.40.0