From 8b4252495f019330d045c6aed05240e1aea35511 Mon Sep 17 00:00:00 2001 From: Regina Obe Date: Fri, 30 Dec 2011 08:48:50 +0000 Subject: [PATCH] change ST_AsSVG to use default args and support named args. Also correct misstatement in geography code as to the ordering of args thought that ordering makes more logical sense to me (it ain't the way it is) git-svn-id: http://svn.osgeo.org/postgis/trunk@8617 b70326c6-7e19-0410-871a-916f4a2858ee --- doc/reference_output.xml | 27 +++++---------------------- doc/reference_raster.xml | 2 +- postgis/geography.sql.in.c | 19 ++++--------------- postgis/postgis.sql.in.c | 15 ++------------- postgis/postgis_drop.sql.in.c | 4 ++++ 5 files changed, 16 insertions(+), 51 deletions(-) diff --git a/doc/reference_output.xml b/doc/reference_output.xml index 933be8685..f73a25858 100644 --- a/doc/reference_output.xml +++ b/doc/reference_output.xml @@ -817,31 +817,13 @@ SELECT ST_AsGML(3, ST_GeomFromEWKT('POLYHEDRALSURFACE( ((0 0 0, 0 0 1, 0 1 1, 0 text ST_AsSVG - geometry g1 - - - text ST_AsSVG - geography g1 - - - text ST_AsSVG - geometry g1 - integer rel - - - text ST_AsSVG - geography g1 - integer rel + geometry geom + integer rel=0 + integer maxdecimaldigits=15 text ST_AsSVG - geometry g1 - integer rel - integer maxdecimaldigits - - - text ST_AsSVG - geography g1 + geography geog integer rel integer maxdecimaldigits @@ -864,6 +846,7 @@ SELECT ST_AsGML(3, ST_GeomFromEWKT('POLYHEDRALSURFACE( ((0 0 0, 0 0 1, 0 1 1, 0 Availability: 1.2.2. Availability: 1.4.0 Changed in PostGIS 1.4.0 to include L command in absolute path to conform to http://www.w3.org/TR/SVG/paths.html#PathDataBNF + Changed: 2.0.0 to use default args and support named args diff --git a/doc/reference_raster.xml b/doc/reference_raster.xml index e8193a546..88c8b8c71 100644 --- a/doc/reference_raster.xml +++ b/doc/reference_raster.xml @@ -5334,7 +5334,7 @@ FROM dummy_rast; ST_HillShade - Returns the hypothetical illumination of a raster band using azimuth, altitude, brightness, and elevation scale inputs + Returns the hypothetical illumination of a raster band using provided azimuth, altitude, brightness, and elevation scale inputs. Useful for visualizing terrain. diff --git a/postgis/geography.sql.in.c b/postgis/geography.sql.in.c index 5df8ab475..37956b006 100644 --- a/postgis/geography.sql.in.c +++ b/postgis/geography.sql.in.c @@ -385,20 +385,10 @@ CREATE OPERATOR CLASS btree_geography_ops -- SVG OUTPUT -- --- ST_AsSVG(geography, precision, rel) -CREATE OR REPLACE FUNCTION ST_AsSVG(geography,int4,int4) - RETURNS text - AS 'MODULE_PATHNAME','geography_as_svg' - LANGUAGE 'C' IMMUTABLE STRICT; - --- ST_AsSVG(geography, precision) / rel=0 -CREATE OR REPLACE FUNCTION ST_AsSVG(geography,int4) - RETURNS text - AS 'MODULE_PATHNAME','geography_as_svg' - LANGUAGE 'C' IMMUTABLE STRICT; - --- ST_AsSVG(geography) / precision=15, rel=0 -CREATE OR REPLACE FUNCTION ST_AsSVG(geography) +-- ST_AsSVG(geography, rel, precision) +-- rel int4 DEFAULT 0, maxdecimaldigits int4 DEFAULT 15 +-- Changed 2.0.0 to use default args and named args +CREATE OR REPLACE FUNCTION ST_AsSVG(geog geography,rel int4 DEFAULT 0,maxdecimaldigits int4 DEFAULT 15) RETURNS text AS 'MODULE_PATHNAME','geography_as_svg' LANGUAGE 'C' IMMUTABLE STRICT; @@ -410,7 +400,6 @@ CREATE OR REPLACE FUNCTION ST_AsSVG(text) $$ SELECT ST_AsSVG($1::geometry); $$ LANGUAGE 'SQL' IMMUTABLE STRICT; - -- -- GML OUTPUT -- diff --git a/postgis/postgis.sql.in.c b/postgis/postgis.sql.in.c index 196262107..1c7c211c5 100644 --- a/postgis/postgis.sql.in.c +++ b/postgis/postgis.sql.in.c @@ -3145,19 +3145,8 @@ CREATE OR REPLACE FUNCTION ST_GeomFromGeoJson(text) -- SVG OUTPUT ----------------------------------------------------------------------- -- Availability: 1.2.2 -CREATE OR REPLACE FUNCTION ST_AsSVG(geometry,int4,int4) - RETURNS TEXT - AS 'MODULE_PATHNAME','LWGEOM_asSVG' - LANGUAGE 'C' IMMUTABLE STRICT; - --- Availability: 1.2.2 -CREATE OR REPLACE FUNCTION ST_AsSVG(geometry,int4) - RETURNS TEXT - AS 'MODULE_PATHNAME','LWGEOM_asSVG' - LANGUAGE 'C' IMMUTABLE STRICT; - --- Availability: 1.2.2 -CREATE OR REPLACE FUNCTION ST_AsSVG(geometry) +-- Changed: 2.0.0 changed to use default args and allow calling by named args +CREATE OR REPLACE FUNCTION ST_AsSVG(geom geometry,rel int4 DEFAULT 0,maxdecimaldigits int4 DEFAULT 15) RETURNS TEXT AS 'MODULE_PATHNAME','LWGEOM_asSVG' LANGUAGE 'C' IMMUTABLE STRICT; diff --git a/postgis/postgis_drop.sql.in.c b/postgis/postgis_drop.sql.in.c index 02f19357b..9013fa055 100644 --- a/postgis/postgis_drop.sql.in.c +++ b/postgis/postgis_drop.sql.in.c @@ -28,6 +28,10 @@ DROP FUNCTION IF EXISTS box2d_same(box2d, box2d); DROP FUNCTION IF EXISTS box2d_intersects(box2d, box2d); DROP FUNCTION IF EXISTS st_area(geography); -- this one changed to use default parameters DROP FUNCTION IF EXISTS st_asx3d(geometry); -- this one changed to use default parameters so full function deals with it +DROP FUNCTION IF EXISTS st_assvg(geometry); -- changed to use default args +DROP FUNCTION IF EXISTS st_assvg(geometry,int4); -- changed to use default args +DROP FUNCTION IF EXISTS st_assvg(geography); -- changed to use default args +DROP FUNCTION IF EXISTS st_assvg(geography,int4); -- changed to use default args DROP FUNCTION IF EXISTS st_box2d_overleft(box2d, box2d); DROP FUNCTION IF EXISTS st_box2d_overright(box2d, box2d); DROP FUNCTION IF EXISTS st_box2d_left(box2d, box2d); -- 2.40.0