From: Regina Obe Date: Tue, 31 May 2011 01:29:19 +0000 (+0000) Subject: #961- reduce number of functions - Get rid of st_area(geography) and change st_area... X-Git-Tag: 2.0.0alpha1~1515 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=609b340a4c3c9f953364c59b1677327d99aeb639;p=postgis #961- reduce number of functions - Get rid of st_area(geography) and change st_area(geography, use_spheroid = true) and also have named argument names so callable by named args git-svn-id: http://svn.osgeo.org/postgis/trunk@7299 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/doc/reference_measure.xml b/doc/reference_measure.xml index b68b58cbc..40ed18241 100644 --- a/doc/reference_measure.xml +++ b/doc/reference_measure.xml @@ -643,12 +643,7 @@ SELECT ST_AsEWKT(ST_3DShortestLine(line,pt)) AS shl3d_line_pt, float ST_Area geography g1 - - - - float ST_Area - geography g1 - boolean use_spheroid + boolean use_spheroid=true diff --git a/postgis/geography.sql.in.c b/postgis/geography.sql.in.c index ca08359a8..d5cd5484a 100644 --- a/postgis/geography.sql.in.c +++ b/postgis/geography.sql.in.c @@ -624,19 +624,12 @@ CREATE OR REPLACE FUNCTION ST_DWithin(text, text, float8) LANGUAGE 'SQL' IMMUTABLE; -- Availability: 1.5.0 -CREATE OR REPLACE FUNCTION ST_Area(geography, boolean) +CREATE OR REPLACE FUNCTION ST_Area(geog geography, use_spheroid boolean DEFAULT true) RETURNS float8 AS 'MODULE_PATHNAME','geography_area' LANGUAGE 'C' IMMUTABLE STRICT COST 100; --- Currently defaulting to spheroid calculations --- Availability: 1.5.0 -CREATE OR REPLACE FUNCTION ST_Area(geography) - RETURNS float8 - AS 'SELECT ST_Area($1, true)' - LANGUAGE 'SQL' IMMUTABLE STRICT; - -- Availability: 1.5.0 - this is just a hack to prevent unknown from causing ambiguous name because of geography -- TODO Remove in 2.0 CREATE OR REPLACE FUNCTION ST_Area(text) diff --git a/postgis/postgis_drop.sql.in.c b/postgis/postgis_drop.sql.in.c index be60d4837..bb6ff9753 100644 --- a/postgis/postgis_drop.sql.in.c +++ b/postgis/postgis_drop.sql.in.c @@ -14,6 +14,7 @@ DROP FUNCTION IF EXISTS box2d_contained(box2d, box2d); DROP FUNCTION IF EXISTS box2d_overlap(box2d, box2d); 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_box2d_overleft(box2d, box2d); DROP FUNCTION IF EXISTS st_box2d_overright(box2d, box2d);