From 456df7ed2cdb73f6fc73642ec221ee55b38531e2 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Thu, 13 Sep 2012 09:53:02 +0000 Subject: [PATCH] ST_Estimated_Extent renamed to ST_EstimatedExtent (#1994) ST_Estimated_Extent is kept but deprecated, testcases test both signatures. Documentation documents the new name and warns about it being renamed in 2.1.0 git-svn-id: http://svn.osgeo.org/postgis/trunk@10279 b70326c6-7e19-0410-871a-916f4a2858ee --- NEWS | 4 ++++ doc/reference_misc.xml | 13 +++++++------ postgis/postgis.sql.in.c | 12 ++++++++++++ regress/tickets.sql | 12 +++++++----- regress/tickets_expected | 4 ++++ 5 files changed, 34 insertions(+), 11 deletions(-) diff --git a/NEWS b/NEWS index 86b3f0419..3239521f3 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,10 @@ PostGIS 2.1.0 - ST_Intersects(raster, geometry) behaves in the same manner as ST_Intersects(geometry, raster). +* Deprecated signatures + + - ST_Estimated_Extent renamed to ST_EstimatedExtent + * New Features * - ST_Segmentize(geography) (Paul Ramsey / OpenGeo) diff --git a/doc/reference_misc.xml b/doc/reference_misc.xml index 19a06acca..87a194b22 100644 --- a/doc/reference_misc.xml +++ b/doc/reference_misc.xml @@ -166,7 +166,7 @@ all_em|grabone | grab_rest - ST_Estimated_Extent + ST_EstimatedExtent Return the 'estimated' extent of the given spatial table. The estimated is taken from the geometry column's statistics. The @@ -176,14 +176,14 @@ all_em|grabone | grab_rest - box2d ST_Estimated_Extent + box2d ST_EstimatedExtent text schema_name text table_name text geocolumn_name - box2d ST_Estimated_Extent + box2d ST_EstimatedExtent text table_name text geocolumn_name @@ -213,7 +213,8 @@ instead. For PostgreSQL<8.0.0 statistics are gathered by update_geometry_stats() and resulting extent will be exact. - Availability: 1.0.0 + Availability: 1.0.0 + NOTE: this function was renamed from "ST_Estimated_Extent" in 2.1.0 &curve_support; @@ -222,11 +223,11 @@ instead. Examples - SELECT ST_Estimated_extent('ny', 'edges', 'the_geom'); + SELECT ST_EstimatedExtent('ny', 'edges', 'the_geom'); --result-- BOX(-8877653 4912316,-8010225.5 5589284) -SELECT ST_Estimated_Extent('feature_poly', 'the_geom'); +SELECT ST_EstimatedExtent('feature_poly', 'the_geom'); --result-- BOX(-124.659652709961 24.6830825805664,-67.7798080444336 49.0012092590332) diff --git a/postgis/postgis.sql.in.c b/postgis/postgis.sql.in.c index 021ba0572..5494a01ed 100644 --- a/postgis/postgis.sql.in.c +++ b/postgis/postgis.sql.in.c @@ -851,18 +851,30 @@ CREATE OR REPLACE FUNCTION ST_Combine_BBox(box2d,geometry) -- ESTIMATED_EXTENT( , , ) ----------------------------------------------------------------------- -- Availability: 1.2.2 +-- Deprecation in 2.1.0 CREATE OR REPLACE FUNCTION ST_estimated_extent(text,text,text) RETURNS box2d AS 'MODULE_PATHNAME', 'geometry_estimated_extent' LANGUAGE 'c' IMMUTABLE STRICT SECURITY DEFINER; +-- Availability: 2.1.0 +CREATE OR REPLACE FUNCTION ST_EstimatedExtent(text,text,text) RETURNS box2d AS + 'MODULE_PATHNAME', 'geometry_estimated_extent' + LANGUAGE 'c' IMMUTABLE STRICT SECURITY DEFINER; + ----------------------------------------------------------------------- -- ESTIMATED_EXTENT(
, ) ----------------------------------------------------------------------- -- Availability: 1.2.2 +-- Deprecation in 2.1.0 CREATE OR REPLACE FUNCTION ST_estimated_extent(text,text) RETURNS box2d AS 'MODULE_PATHNAME', 'geometry_estimated_extent' LANGUAGE 'c' IMMUTABLE STRICT SECURITY DEFINER; +-- Availability: 2.1.0 +CREATE OR REPLACE FUNCTION ST_EstimatedExtent(text,text) RETURNS box2d AS + 'MODULE_PATHNAME', 'geometry_estimated_extent' + LANGUAGE 'c' IMMUTABLE STRICT SECURITY DEFINER; + ----------------------------------------------------------------------- -- FIND_EXTENT( ,
, ) ----------------------------------------------------------------------- diff --git a/regress/tickets.sql b/regress/tickets.sql index d336267cc..cb9c4ed54 100644 --- a/regress/tickets.sql +++ b/regress/tickets.sql @@ -449,15 +449,17 @@ SELECT '#1273.1', st_equals(p.g, postgis_dropbbox(p.g)) from p; -- #877, #818 create table t(g geometry); -select '#877.1', st_estimated_extent('t','g'); +select '#877.1', ST_EstimatedExtent('t','g'); analyze t; -select '#877.2', st_estimated_extent('public', 't','g'); +select '#877.2', ST_EstimatedExtent('public', 't','g'); +select '#877.2.deprecated', ST_Estimated_Extent('public', 't','g'); insert into t(g) values ('LINESTRING(-10 -50, 20 30)'); -select '#877.3', st_estimated_extent('t','g'); +select '#877.3', ST_EstimatedExtent('t','g'); analyze t; -select '#877.4', st_estimated_extent('t','g'); +select '#877.4', ST_EstimatedExtent('t','g'); truncate t; -select '#818.1', st_estimated_extent('t','g'); +select '#818.1', ST_EstimatedExtent('t','g'); +select '#818.1.deprecated', ST_Estimated_Extent('t','g'); drop table t; -- #1320 diff --git a/regress/tickets_expected b/regress/tickets_expected index 29759788c..dea31a9e6 100644 --- a/regress/tickets_expected +++ b/regress/tickets_expected @@ -146,11 +146,15 @@ NOTICE: ""."t"."g" is empty or not analyzed #877.1| NOTICE: "public"."t"."g" is empty or not analyzed #877.2| +NOTICE: "public"."t"."g" is empty or not analyzed +#877.2.deprecated| NOTICE: ""."t"."g" is empty or not analyzed #877.3| #877.4|BOX(-10 -50,20 30) NOTICE: ""."t"."g" is empty or not analyzed #818.1| +NOTICE: ""."t"."g" is empty or not analyzed +#818.1.deprecated| <#1320> #1320.geog.1|MULTIPOLYGON|4326 #1320.geom.1|MULTIPOLYGON|4326 -- 2.40.0