From: Sandro Santilli Date: Fri, 10 May 2013 15:00:38 +0000 (+0000) Subject: ST_Force_XXX renamed to ST_ForceXXX X-Git-Tag: 2.1.0beta2~22 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c17e2878f7706254d4f562cceaa61896c3b03457;p=postgis ST_Force_XXX renamed to ST_ForceXXX git-svn-id: http://svn.osgeo.org/postgis/trunk@11406 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/NEWS b/NEWS index a4e94e323..9ef976c10 100644 --- a/NEWS +++ b/NEWS @@ -32,6 +32,7 @@ PostGIS 2.1.0 - ST_Line_Interpolate_Point renamed to ST_LineInterpolatePoint - ST_Line_Substring renamed to ST_LineSubstring - ST_Line_Locate_Point renamed to ST_LineLocatePoint + - ST_Force_XXX renamed to ST_ForceXXX - ST_MapAlgebraFctNgb and 1 and 2 raster variants of ST_MapAlgebraFct. Use ST_MapAlgebra instead - 1 and 2 raster variants of ST_MapAlgebraExpr. diff --git a/doc/performance_tips.xml b/doc/performance_tips.xml index 730c1876f..5ccb539fc 100644 --- a/doc/performance_tips.xml +++ b/doc/performance_tips.xml @@ -59,7 +59,7 @@ example, the commands are like: SELECT AddGeometryColumn('myschema','mytable','bbox','4326','GEOMETRY','2'); -UPDATE mytable SET bbox = ST_Envelope(ST_Force_2d(the_geom)); +UPDATE mytable SET bbox = ST_Envelope(ST_Force2D(the_geom)); Now change your query to use the && operator against bbox instead of geom_column, like: @@ -115,11 +115,11 @@ ALTER TABLE Sometimes, you happen to have 3D or 4D data in your table, but always access it using OpenGIS compliant ST_AsText() or ST_AsBinary() functions that only output 2D geometries. They do this by internally - calling the ST_Force_2d() function, which introduces a significant + calling the ST_Force2D() function, which introduces a significant overhead for large geometries. To avoid this overhead, it may be feasible to pre-drop those additional dimensions once and forever: - UPDATE mytable SET the_geom = ST_Force_2d(the_geom); + UPDATE mytable SET the_geom = ST_Force2D(the_geom); VACUUM FULL ANALYZE mytable; Note that if you added your geometry column using diff --git a/doc/reference_editor.xml b/doc/reference_editor.xml index de8cb04ef..df4dd33c1 100644 --- a/doc/reference_editor.xml +++ b/doc/reference_editor.xml @@ -172,7 +172,7 @@ SELECT ST_AsEWKT(ST_Affine(the_geom, cos(pi()), -sin(pi()), 0, sin(pi()), cos(pi - ST_Force_2D + ST_Force2D Forces the geometries into a "2-dimensional mode" so that all output representations will only have the X and Y coordinates. @@ -181,7 +181,7 @@ SELECT ST_AsEWKT(ST_Affine(the_geom, cos(pi()), -sin(pi()), 0, sin(pi()), cos(pi - geometry ST_Force_2D + geometry ST_Force2D geometry geomA @@ -196,6 +196,7 @@ SELECT ST_AsEWKT(ST_Affine(the_geom, cos(pi()), -sin(pi()), 0, sin(pi()), cos(pi specifies 2-D geometries). Enhanced: 2.0.0 support for Polyhedral surfaces was introduced. + Changed: 2.1.0. Up to 2.0.x this was called ST_Force_2D. &curve_support; &P_support; &Z_support; @@ -205,12 +206,12 @@ SELECT ST_AsEWKT(ST_Affine(the_geom, cos(pi()), -sin(pi()), 0, sin(pi()), cos(pi Examples - SELECT ST_AsEWKT(ST_Force_2D(ST_GeomFromEWKT('CIRCULARSTRING(1 1 2, 2 3 2, 4 5 2, 6 7 2, 5 6 2)'))); + SELECT ST_AsEWKT(ST_Force2D(ST_GeomFromEWKT('CIRCULARSTRING(1 1 2, 2 3 2, 4 5 2, 6 7 2, 5 6 2)'))); st_asewkt ------------------------------------- CIRCULARSTRING(1 1,2 3,4 5,6 7,5 6) -SELECT ST_AsEWKT(ST_Force_2D('POLYGON((0 0 2,0 5 2,5 0 2,0 0 2),(1 1 2,3 1 2,1 3 2,1 1 2))')); +SELECT ST_AsEWKT(ST_Force2D('POLYGON((0 0 2,0 5 2,5 0 2,0 0 2),(1 1 2,3 1 2,1 3 2,1 1 2))')); st_asewkt ---------------------------------------------- @@ -229,15 +230,15 @@ SELECT ST_AsEWKT(ST_Force_2D('POLYGON((0 0 2,0 5 2,5 0 2,0 0 2),(1 1 2,3 1 2,1 - ST_Force_3D + ST_Force3D - Forces the geometries into XYZ mode. This is an alias for ST_Force_3DZ. + Forces the geometries into XYZ mode. This is an alias for ST_Force3DZ. - geometry ST_Force_3D + geometry ST_Force3D geometry geomA @@ -249,6 +250,7 @@ SELECT ST_AsEWKT(ST_Force_2D('POLYGON((0 0 2,0 5 2,5 0 2,0 0 2),(1 1 2,3 1 2,1 Forces the geometries into XYZ mode. This is an alias for ST_Force_3DZ. If a geometry has no Z component, then a 0 Z coordinate is tacked on. Enhanced: 2.0.0 support for Polyhedral surfaces was introduced. + Changed: 2.1.0. Up to 2.0.x this was called ST_Force_3D. &P_support; &curve_support; &Z_support; @@ -260,13 +262,13 @@ SELECT ST_AsEWKT(ST_Force_2D('POLYGON((0 0 2,0 5 2,5 0 2,0 0 2),(1 1 2,3 1 2,1 --Nothing happens to an already 3D geometry - SELECT ST_AsEWKT(ST_Force_3D(ST_GeomFromEWKT('CIRCULARSTRING(1 1 2, 2 3 2, 4 5 2, 6 7 2, 5 6 2)'))); + SELECT ST_AsEWKT(ST_Force3D(ST_GeomFromEWKT('CIRCULARSTRING(1 1 2, 2 3 2, 4 5 2, 6 7 2, 5 6 2)'))); st_asewkt ----------------------------------------------- CIRCULARSTRING(1 1 2,2 3 2,4 5 2,6 7 2,5 6 2) -SELECT ST_AsEWKT(ST_Force_3D('POLYGON((0 0,0 5,5 0,0 0),(1 1,3 1,1 3,1 1))')); +SELECT ST_AsEWKT(ST_Force3D('POLYGON((0 0,0 5,5 0,0 0),(1 1,3 1,1 3,1 1))')); st_asewkt -------------------------------------------------------------- @@ -284,15 +286,15 @@ SELECT ST_AsEWKT(ST_Force_3D('POLYGON((0 0,0 5,5 0,0 0),(1 1,3 1,1 3,1 1))')); - ST_Force_3DZ + ST_Force3DZ - Forces the geometries into XYZ mode. This is a synonym for ST_Force_3D. + Forces the geometries into XYZ mode. This is a synonym for ST_Force3D. - geometry ST_Force_3DZ + geometry ST_Force3DZ geometry geomA @@ -301,9 +303,10 @@ SELECT ST_AsEWKT(ST_Force_3D('POLYGON((0 0,0 5,5 0,0 0),(1 1,3 1,1 3,1 1))')); Description - Forces the geometries into XYZ mode. This is a synonym for ST_Force_3DZ. If a geometry has no Z component, then a 0 Z coordinate is tacked on. + Forces the geometries into XYZ mode. This is a synonym for ST_Force3DZ. If a geometry has no Z component, then a 0 Z coordinate is tacked on. Enhanced: 2.0.0 support for Polyhedral surfaces was introduced. + Changed: 2.1.0. Up to 2.0.x this was called ST_Force_3DZ. &P_support; &Z_support; &curve_support; @@ -315,13 +318,13 @@ SELECT ST_AsEWKT(ST_Force_3D('POLYGON((0 0,0 5,5 0,0 0),(1 1,3 1,1 3,1 1))')); --Nothing happens to an already 3D geometry -SELECT ST_AsEWKT(ST_Force_3DZ(ST_GeomFromEWKT('CIRCULARSTRING(1 1 2, 2 3 2, 4 5 2, 6 7 2, 5 6 2)'))); +SELECT ST_AsEWKT(ST_Force3DZ(ST_GeomFromEWKT('CIRCULARSTRING(1 1 2, 2 3 2, 4 5 2, 6 7 2, 5 6 2)'))); st_asewkt ----------------------------------------------- CIRCULARSTRING(1 1 2,2 3 2,4 5 2,6 7 2,5 6 2) -SELECT ST_AsEWKT(ST_Force_3DZ('POLYGON((0 0,0 5,5 0,0 0),(1 1,3 1,1 3,1 1))')); +SELECT ST_AsEWKT(ST_Force3DZ('POLYGON((0 0,0 5,5 0,0 0),(1 1,3 1,1 3,1 1))')); st_asewkt -------------------------------------------------------------- @@ -339,7 +342,7 @@ SELECT ST_AsEWKT(ST_Force_3DZ('POLYGON((0 0,0 5,5 0,0 0),(1 1,3 1,1 3,1 1))')); - ST_Force_3DM + ST_Force3DM Forces the geometries into XYM mode. @@ -347,7 +350,7 @@ SELECT ST_AsEWKT(ST_Force_3DZ('POLYGON((0 0,0 5,5 0,0 0),(1 1,3 1,1 3,1 1))')); - geometry ST_Force_3DM + geometry ST_Force3DM geometry geomA @@ -359,6 +362,7 @@ SELECT ST_AsEWKT(ST_Force_3DZ('POLYGON((0 0,0 5,5 0,0 0),(1 1,3 1,1 3,1 1))')); Forces the geometries into XYM mode. If a geometry has no M component, then a 0 M coordinate is tacked on. If it has a Z component, then Z is removed + Changed: 2.1.0. Up to 2.0.x this was called ST_Force_3DM. &curve_support; @@ -368,13 +372,13 @@ SELECT ST_AsEWKT(ST_Force_3DZ('POLYGON((0 0,0 5,5 0,0 0),(1 1,3 1,1 3,1 1))')); --Nothing happens to an already 3D geometry -SELECT ST_AsEWKT(ST_Force_3DM(ST_GeomFromEWKT('CIRCULARSTRING(1 1 2, 2 3 2, 4 5 2, 6 7 2, 5 6 2)'))); +SELECT ST_AsEWKT(ST_Force3DM(ST_GeomFromEWKT('CIRCULARSTRING(1 1 2, 2 3 2, 4 5 2, 6 7 2, 5 6 2)'))); st_asewkt ------------------------------------------------ CIRCULARSTRINGM(1 1 0,2 3 0,4 5 0,6 7 0,5 6 0) -SELECT ST_AsEWKT(ST_Force_3DM('POLYGON((0 0 1,0 5 1,5 0 1,0 0 1),(1 1 1,3 1 1,1 3 1,1 1 1))')); +SELECT ST_AsEWKT(ST_Force3DM('POLYGON((0 0 1,0 5 1,5 0 1,0 0 1),(1 1 1,3 1 1,1 3 1,1 1 1))')); st_asewkt --------------------------------------------------------------- @@ -393,7 +397,7 @@ SELECT ST_AsEWKT(ST_Force_3DM('POLYGON((0 0 1,0 5 1,5 0 1,0 0 1),(1 1 1,3 1 1,1 - ST_Force_4D + ST_Force4D Forces the geometries into XYZM mode. @@ -401,7 +405,7 @@ SELECT ST_AsEWKT(ST_Force_3DM('POLYGON((0 0 1,0 5 1,5 0 1,0 0 1),(1 1 1,3 1 1,1 - geometry ST_Force_4D + geometry ST_Force4D geometry geomA @@ -412,6 +416,7 @@ SELECT ST_AsEWKT(ST_Force_3DM('POLYGON((0 0 1,0 5 1,5 0 1,0 0 1),(1 1 1,3 1 1,1 Forces the geometries into XYZM mode. 0 is tacked on for missing Z and M dimensions. + Changed: 2.1.0. Up to 2.0.x this was called ST_Force_4D. &Z_support; &curve_support; @@ -422,14 +427,14 @@ SELECT ST_AsEWKT(ST_Force_3DM('POLYGON((0 0 1,0 5 1,5 0 1,0 0 1),(1 1 1,3 1 1,1 --Nothing happens to an already 3D geometry -SELECT ST_AsEWKT(ST_Force_4D(ST_GeomFromEWKT('CIRCULARSTRING(1 1 2, 2 3 2, 4 5 2, 6 7 2, 5 6 2)'))); +SELECT ST_AsEWKT(ST_Force4D(ST_GeomFromEWKT('CIRCULARSTRING(1 1 2, 2 3 2, 4 5 2, 6 7 2, 5 6 2)'))); st_asewkt --------------------------------------------------------- CIRCULARSTRING(1 1 2 0,2 3 2 0,4 5 2 0,6 7 2 0,5 6 2 0) -SELECT ST_AsEWKT(ST_Force_4D('MULTILINESTRINGM((0 0 1,0 5 2,5 0 3,0 0 4),(1 1 1,3 1 1,1 3 1,1 1 1))')); +SELECT ST_AsEWKT(ST_Force4D('MULTILINESTRINGM((0 0 1,0 5 2,5 0 3,0 0 4),(1 1 1,3 1 1,1 3 1,1 1 1))')); st_asewkt -------------------------------------------------------------------------------------- @@ -448,7 +453,7 @@ SELECT ST_AsEWKT(ST_Force_4D('MULTILINESTRINGM((0 0 1,0 5 2,5 0 3,0 0 4),(1 1 1 - ST_Force_Collection + ST_ForceCollection Converts the geometry into a GEOMETRYCOLLECTION. @@ -456,7 +461,7 @@ SELECT ST_AsEWKT(ST_Force_4D('MULTILINESTRINGM((0 0 1,0 5 2,5 0 3,0 0 4),(1 1 1 - geometry ST_Force_Collection + geometry ST_ForceCollection geometry geomA @@ -470,6 +475,7 @@ SELECT ST_AsEWKT(ST_Force_4D('MULTILINESTRINGM((0 0 1,0 5 2,5 0 3,0 0 4),(1 1 1 Enhanced: 2.0.0 support for Polyhedral surfaces was introduced. Availability: 1.2.2, prior to 1.3.4 this function will crash with Curves. This is fixed in 1.3.4+ + Changed: 2.1.0. Up to 2.0.x this was called ST_Force_Collection. &P_support; &Z_support; @@ -482,14 +488,14 @@ SELECT ST_AsEWKT(ST_Force_4D('MULTILINESTRINGM((0 0 1,0 5 2,5 0 3,0 0 4),(1 1 1 -SELECT ST_AsEWKT(ST_Force_Collection('POLYGON((0 0 1,0 5 1,5 0 1,0 0 1),(1 1 1,3 1 1,1 3 1,1 1 1))')); +SELECT ST_AsEWKT(ST_ForceCollection('POLYGON((0 0 1,0 5 1,5 0 1,0 0 1),(1 1 1,3 1 1,1 3 1,1 1 1))')); st_asewkt ---------------------------------------------------------------------------------- GEOMETRYCOLLECTION(POLYGON((0 0 1,0 5 1,5 0 1,0 0 1),(1 1 1,3 1 1,1 3 1,1 1 1))) - SELECT ST_AsText(ST_Force_Collection('CIRCULARSTRING(220227 150406,2220227 150407,220227 150406)')); + SELECT ST_AsText(ST_ForceCollection('CIRCULARSTRING(220227 150406,2220227 150407,220227 150406)')); st_astext -------------------------------------------------------------------------------- GEOMETRYCOLLECTION(CIRCULARSTRING(220227 150406,2220227 150407,220227 150406)) @@ -499,7 +505,7 @@ SELECT ST_AsEWKT(ST_Force_Collection('POLYGON((0 0 1,0 5 1,5 0 1,0 0 1),(1 1 1, -- POLYHEDRAL example -- -SELECT ST_AsEWKT(ST_Force_Collection('POLYHEDRALSURFACE(((0 0 0,0 0 1,0 1 1,0 1 0,0 0 0)), +SELECT ST_AsEWKT(ST_ForceCollection('POLYHEDRALSURFACE(((0 0 0,0 0 1,0 1 1,0 1 0,0 0 0)), ((0 0 0,0 1 0,1 1 0,1 0 0,0 0 0)), ((0 0 0,1 0 0,1 0 1,0 0 1,0 0 0)), ((1 1 0,1 1 1,1 0 1,1 0 0,1 1 0)), diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in index f0e4eb63a..415d087ef 100644 --- a/postgis/postgis.sql.in +++ b/postgis/postgis.sql.in @@ -1168,43 +1168,97 @@ CREATE OR REPLACE FUNCTION ST_azimuth(geom1 geometry, geom2 geometry) ------------------------------------------------------------------------ -- MISC ------------------------------------------------------------------------ --- Availability: 1.2.2 -CREATE OR REPLACE FUNCTION ST_force_2d(geometry) + +-- Availability: 2.1.0 +CREATE OR REPLACE FUNCTION ST_Force2D(geometry) RETURNS geometry AS 'MODULE_PATHNAME', 'LWGEOM_force_2d' LANGUAGE 'c' IMMUTABLE STRICT; -- Availability: 1.2.2 -CREATE OR REPLACE FUNCTION ST_force_3dz(geometry) +-- Deprecation in 2.1.0 +CREATE OR REPLACE FUNCTION ST_force_2d(geometry) + RETURNS geometry AS + $$ SELECT _postgis_deprecate('ST_Force_2d', 'ST_Force2D', '2.1.0'); + SELECT ST_Force2D($1); + $$ + LANGUAGE 'sql' IMMUTABLE STRICT; + +-- Availability: 2.1.0 +CREATE OR REPLACE FUNCTION ST_Force3DZ(geometry) RETURNS geometry AS 'MODULE_PATHNAME', 'LWGEOM_force_3dz' LANGUAGE 'c' IMMUTABLE STRICT; - -- Availability: 1.2.2 -CREATE OR REPLACE FUNCTION ST_force_3d(geometry) +-- Deprecation in 2.1.0 +CREATE OR REPLACE FUNCTION ST_force_3dz(geometry) + RETURNS geometry AS + $$ SELECT _postgis_deprecate('ST_Force_3dz', 'ST_Force3DZ', '2.1.0'); + SELECT ST_Force3DZ($1); + $$ + LANGUAGE 'sql' IMMUTABLE STRICT; + +-- Availability: 2.1.0 +CREATE OR REPLACE FUNCTION ST_Force3D(geometry) RETURNS geometry AS 'MODULE_PATHNAME', 'LWGEOM_force_3dz' LANGUAGE 'c' IMMUTABLE STRICT; -- Availability: 1.2.2 -CREATE OR REPLACE FUNCTION ST_force_3dm(geometry) +-- Deprecation in 2.1.0 +CREATE OR REPLACE FUNCTION ST_force_3d(geometry) + RETURNS geometry AS + $$ SELECT _postgis_deprecate('ST_Force_3d', 'ST_Force3D', '2.1.0'); + SELECT ST_Force3D($1); + $$ + LANGUAGE 'sql' IMMUTABLE STRICT; + +-- Availability: 2.1.0 +CREATE OR REPLACE FUNCTION ST_Force3DM(geometry) RETURNS geometry AS 'MODULE_PATHNAME', 'LWGEOM_force_3dm' LANGUAGE 'c' IMMUTABLE STRICT; -- Availability: 1.2.2 -CREATE OR REPLACE FUNCTION ST_force_4d(geometry) +-- Deprecation in 2.1.0 +CREATE OR REPLACE FUNCTION ST_force_3dm(geometry) + RETURNS geometry AS + $$ SELECT _postgis_deprecate('ST_Force_3dm', 'ST_Force3DM', '2.1.0'); + SELECT ST_Force3DM($1); + $$ + LANGUAGE 'sql' IMMUTABLE STRICT; + +-- Availability: 2.1.0 +CREATE OR REPLACE FUNCTION ST_Force4D(geometry) RETURNS geometry AS 'MODULE_PATHNAME', 'LWGEOM_force_4d' LANGUAGE 'c' IMMUTABLE STRICT; -- Availability: 1.2.2 -CREATE OR REPLACE FUNCTION ST_force_collection(geometry) +-- Deprecation in 2.1.0 +CREATE OR REPLACE FUNCTION ST_force_4d(geometry) + RETURNS geometry AS + $$ SELECT _postgis_deprecate('ST_Force_4d', 'ST_Force4D', '2.1.0'); + SELECT ST_Force4D($1); + $$ + LANGUAGE 'sql' IMMUTABLE STRICT; + +-- Availability: 2.1.0 +CREATE OR REPLACE FUNCTION ST_ForceCollection(geometry) RETURNS geometry AS 'MODULE_PATHNAME', 'LWGEOM_force_collection' LANGUAGE 'c' IMMUTABLE STRICT; +-- Availability: 1.2.2 +-- Deprecation in 2.1.0 +CREATE OR REPLACE FUNCTION ST_force_collection(geometry) + RETURNS geometry AS + $$ SELECT _postgis_deprecate('ST_Force_Collection', 'ST_ForceCollection', '2.1.0'); + SELECT ST_ForceCollection($1); + $$ + LANGUAGE 'sql' IMMUTABLE STRICT; + -- Availability: 1.5.0 CREATE OR REPLACE FUNCTION ST_CollectionExtract(geometry, integer) RETURNS geometry diff --git a/regress/binary.sql b/regress/binary.sql index b1895338d..7a36b6546 100644 --- a/regress/binary.sql +++ b/regress/binary.sql @@ -21,11 +21,11 @@ INSERT INTO tm.geoms(g) values ('TIN EMPTY'); -- all zm flags INSERT INTO tm.geoms(g) -SELECT st_force_3dz(g) FROM tm.geoms WHERE id < 15 ORDER BY id; +SELECT st_force3dz(g) FROM tm.geoms WHERE id < 15 ORDER BY id; INSERT INTO tm.geoms(g) -SELECT st_force_3dm(g) FROM tm.geoms WHERE id < 15 ORDER BY id; +SELECT st_force3dm(g) FROM tm.geoms WHERE id < 15 ORDER BY id; INSERT INTO tm.geoms(g) -SELECT st_force_4d(g) FROM tm.geoms WHERE id < 15 ORDER BY id; +SELECT st_force4d(g) FROM tm.geoms WHERE id < 15 ORDER BY id; -- known srid INSERT INTO tm.geoms(g) diff --git a/regress/lwgeom_regress.sql b/regress/lwgeom_regress.sql index fe4ae97c7..0e00aa8e7 100644 --- a/regress/lwgeom_regress.sql +++ b/regress/lwgeom_regress.sql @@ -93,10 +93,10 @@ SELECT id,wkt FROM test_data WHERE SELECT ST_extent(geometry(wkb_ndr)) from test_data; SELECT ST_3DExtent(geometry(wkb_ndr)) from test_data WHERE ST_NDims(wkb_ndr) > 2; -SELECT ST_mem_size(ST_collect(ST_force_2d(geometry(wkb_ndr)))) from test_data; -SELECT ST_mem_size(ST_collect(ST_force_3dz(geometry(wkb_ndr)))) from test_data; -SELECT ST_mem_size(ST_collect(ST_force_4d(ST_force_2d(geometry(wkb_ndr))))) from test_data; -SELECT ST_mem_size(ST_collect(ST_force_3dm(geometry(wkb_ndr)))) from test_data; -SELECT ST_mem_size(ST_collect(ST_force_2d(ST_force_4d(ST_force_3dm(ST_force_3dz(ST_force_2d(geometry(wkb_ndr)))))))) from test_data; +SELECT ST_mem_size(ST_collect(ST_Force2d(geometry(wkb_ndr)))) from test_data; +SELECT ST_mem_size(ST_collect(ST_Force3dz(geometry(wkb_ndr)))) from test_data; +SELECT ST_mem_size(ST_collect(ST_Force4d(ST_force2d(geometry(wkb_ndr))))) from test_data; +SELECT ST_mem_size(ST_collect(ST_Force3dm(geometry(wkb_ndr)))) from test_data; +SELECT ST_mem_size(ST_collect(ST_Force2d(ST_force4d(ST_force3dm(ST_force3dz(ST_force2d(geometry(wkb_ndr)))))))) from test_data; DROP TABLE test_data; diff --git a/regress/regress.sql b/regress/regress.sql index 88560edf9..1057a4052 100644 --- a/regress/regress.sql +++ b/regress/regress.sql @@ -234,16 +234,16 @@ select '141', ST_AsEWKT(ST_multi(ST_setsrid('LINESTRING(2 2, 3 3)'::geometry, 4) select '142', ST_AsEWKT(ST_multi(ST_setsrid('LINESTRING(2 2, 3 3)'::geometry, 5))); select '143', ST_AsEWKT(ST_multi(ST_setsrid('POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))'::geometry, 6))); select '143c1', ST_AsEWKT(ST_multi('CIRCULARSTRING(0 0, 1 1, 2 2)'::geometry)); -select '144', ST_AsEWKT(ST_force_3dm('POINT(1 2 3)')); -select '145', ST_AsEWKT(ST_force_3dz('POINTM(1 2 3)')); -select '146', ST_AsEWKT(ST_force_4d('POINTM(1 2 3)')); -select '147', ST_AsEWKT(ST_force_4d('POINT(1 2 3)')); +select '144', ST_AsEWKT(ST_Force3DM('POINT(1 2 3)')); +select '145', ST_AsEWKT(ST_Force3DZ('POINTM(1 2 3)')); +select '146', ST_AsEWKT(ST_Force4D('POINTM(1 2 3)')); +select '147', ST_AsEWKT(ST_Force4D('POINT(1 2 3)')); select '148', ST_AsText(ST_segmentize('LINESTRING(0 0, 10 0)'::geometry, 5)); select '149', ST_AsText(ST_segmentize('GEOMETRYCOLLECTION EMPTY'::geometry, 0.5)); -select '150', ST_AsEWKT(ST_force_collection(ST_setsrid('POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))'::geometry, 6))); +select '150', ST_AsEWKT(ST_ForceCollection(ST_setsrid('POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))'::geometry, 6))); select '151', ST_MakeEnvelope(0, 0, 1, 1, 4326); select '152', ST_SRID(ST_MakeEnvelope(0, 0, 1, 1, 4326)); diff --git a/regress/tickets.sql b/regress/tickets.sql index ed7d4a37a..21179c72f 100644 --- a/regress/tickets.sql +++ b/regress/tickets.sql @@ -71,7 +71,7 @@ SELECT '#69', ST_AsText(ST_Translate(ST_GeomFromText('CIRCULARSTRING(220268 1504 SELECT '#70', ST_NPoints(ST_LinetoCurve(ST_Buffer('POINT(1 2)',3))); -- #73 -- -SELECT '#73', ST_AsText(ST_Force_Collection(ST_GeomFromEWKT('CIRCULARSTRING(1 1, 2 3, 4 5, 6 7, 5 6)'))); +SELECT '#73', ST_AsText(ST_ForceCollection(ST_GeomFromEWKT('CIRCULARSTRING(1 1, 2 3, 4 5, 6 7, 5 6)'))); -- #80 -- SELECT '#80', ST_AsText(ST_Multi('MULTILINESTRING((0 0,1 1))')); @@ -553,7 +553,7 @@ with inp as ( select 'MULTILINESTRING((0 0, 2 0))'::geometry as g ) SELECT '#1454', st_orderingequals(g,g) from inp; -- #1414 -SELECT '#1414', st_astext(st_force_3dz('CURVEPOLYGON EMPTY')); +SELECT '#1414', st_astext(st_Force3DZ('CURVEPOLYGON EMPTY')); -- #1478 SELECT '#1478', 'SRID=1;POINT EMPTY'::geometry::text::geometry; diff --git a/regress/typmod.sql b/regress/typmod.sql index 19c0b33b1..83c5bcde3 100644 --- a/regress/typmod.sql +++ b/regress/typmod.sql @@ -248,11 +248,11 @@ INSERT INTO tm.types(g) values ('TIN EMPTY'); -- all zm flags INSERT INTO tm.types(g) -SELECT st_force_3dz(g) FROM tm.types WHERE id < 15 ORDER BY id; +SELECT st_force3dz(g) FROM tm.types WHERE id < 15 ORDER BY id; INSERT INTO tm.types(g) -SELECT st_force_3dm(g) FROM tm.types WHERE id < 15 ORDER BY id; +SELECT st_force3dm(g) FROM tm.types WHERE id < 15 ORDER BY id; INSERT INTO tm.types(g) -SELECT st_force_4d(g) FROM tm.types WHERE id < 15 ORDER BY id; +SELECT st_force4d(g) FROM tm.types WHERE id < 15 ORDER BY id; -- known srid INSERT INTO tm.types(g) diff --git a/regress/wmsservers.sql b/regress/wmsservers.sql index f5404c78e..a4a573253 100644 --- a/regress/wmsservers.sql +++ b/regress/wmsservers.sql @@ -15,23 +15,23 @@ SELECT 'Running Geoserver 2.0 NG tests...'; SELECT 'Geoserver1', upper(TYPE) As TYPE FROM GEOMETRY_COLUMNS WHERE F_TABLE_SCHEMA = 'public' AND F_TABLE_NAME = 'wmstest' AND F_GEOMETRY_COLUMN = 'pt'; SELECT 'Geoserver2', SRID FROM GEOMETRY_COLUMNS WHERE F_TABLE_SCHEMA = 'public' AND F_TABLE_NAME = 'wmstest' AND F_GEOMETRY_COLUMN = 'pt'; -- Run a Geoserver 2.0 NG WMS query -SELECT 'Geoserver3', "id",substr(encode(ST_AsBinary(ST_Force_2d("pt"),'XDR'),'base64'),0,16) as "pt" FROM "public"."wmstest" WHERE "pt" && ST_GeomFromText('POLYGON ((-6.58216065979069 -0.7685569763184591, -6.58216065979069 0.911225433349509, -3.050569931030911 0.911225433349509, -3.050569931030911 -0.7685569763184591, -6.58216065979069 -0.7685569763184591))', 4326); +SELECT 'Geoserver3', "id",substr(encode(ST_AsBinary(ST_Force2d("pt"),'XDR'),'base64'),0,16) as "pt" FROM "public"."wmstest" WHERE "pt" && ST_GeomFromText('POLYGON ((-6.58216065979069 -0.7685569763184591, -6.58216065979069 0.911225433349509, -3.050569931030911 0.911225433349509, -3.050569931030911 -0.7685569763184591, -6.58216065979069 -0.7685569763184591))', 4326); -- Run a Geoserver 2.0 NG KML query SELECT 'Geoserver4', count(*) FROM "public"."wmstest" WHERE "pt" && ST_GeomFromText('POLYGON ((-1.504017942347938 24.0332272532341, -1.504017942347938 25.99364254836741, 1.736833353559741 25.99364254836741, 1.736833353559741 24.0332272532341, -1.504017942347938 24.0332272532341))', 4326); -SELECT 'Geoserver5', "id",substr(encode(ST_AsBinary(ST_Force_2d("pt"),'XDR'),'base64'),0,16) as "pt" FROM "public"."wmstest" WHERE "pt" && ST_GeomFromText('POLYGON ((-1.504017942347938 24.0332272532341, -1.504017942347938 25.99364254836741, 1.736833353559741 25.99364254836741, 1.736833353559741 24.0332272532341, -1.504017942347938 24.0332272532341))', 4326); -SELECT 'Geoserver6', "id",substr(encode(ST_AsBinary(ST_Force_2d("pt"),'XDR'),'base64'),0,16) as "pt" FROM "public"."wmstest" WHERE "pt" && ST_GeomFromText('POLYGON ((-1.507182836191598 24.031312785172446, -1.507182836191598 25.995557016429064, 1.7399982474034008 25.995557016429064, 1.7399982474034008 24.031312785172446, -1.507182836191598 24.031312785172446))', 4326); +SELECT 'Geoserver5', "id",substr(encode(ST_AsBinary(ST_Force2d("pt"),'XDR'),'base64'),0,16) as "pt" FROM "public"."wmstest" WHERE "pt" && ST_GeomFromText('POLYGON ((-1.504017942347938 24.0332272532341, -1.504017942347938 25.99364254836741, 1.736833353559741 25.99364254836741, 1.736833353559741 24.0332272532341, -1.504017942347938 24.0332272532341))', 4326); +SELECT 'Geoserver6', "id",substr(encode(ST_AsBinary(ST_Force2d("pt"),'XDR'),'base64'),0,16) as "pt" FROM "public"."wmstest" WHERE "pt" && ST_GeomFromText('POLYGON ((-1.507182836191598 24.031312785172446, -1.507182836191598 25.995557016429064, 1.7399982474034008 25.995557016429064, 1.7399982474034008 24.031312785172446, -1.507182836191598 24.031312785172446))', 4326); -- MapServer 5.4 tests select 'MapServer1', attname from pg_attribute, pg_constraint, pg_class where pg_constraint.conrelid = pg_class.oid and pg_class.oid = pg_attribute.attrelid and pg_constraint.contype = 'p' and pg_constraint.conkey[1] = pg_attribute.attnum and pg_class.relname = 'wmstest' and pg_table_is_visible(pg_class.oid) and pg_constraint.conkey[2] is null; -select 'MapServer2', "id",substr(encode(ST_AsBinary(ST_Force_collection(ST_Force_2d("pt")),'NDR'),'base64'),0,16) as geom,"id" from wmstest where pt && ST_GeomFromText('POLYGON((-98.5 32,-98.5 39,-91.5 39,-91.5 32,-98.5 32))',find_srid('','wmstest','pt')); +select 'MapServer2', "id",substr(encode(ST_AsBinary(ST_ForceCollection(ST_Force2d("pt")),'NDR'),'base64'),0,16) as geom,"id" from wmstest where pt && ST_GeomFromText('POLYGON((-98.5 32,-98.5 39,-91.5 39,-91.5 32,-98.5 32))',find_srid('','wmstest','pt')); -- MapServer 5.6 tests select * from wmstest where false limit 0; select 'MapServer3', attname from pg_attribute, pg_constraint, pg_class where pg_constraint.conrelid = pg_class.oid and pg_class.oid = pg_attribute.attrelid and pg_constraint.contype = 'p' and pg_constraint.conkey[1] = pg_attribute.attnum and pg_class.relname = 'wmstest' and pg_table_is_visible(pg_class.oid) and pg_constraint.conkey[2] is null; -select 'MapServer4', "id",substr(encode(ST_AsBinary(ST_Force_collection(ST_Force_2d("pt")),'NDR'),'hex'),0,16) as geom,"id" from wmstest where pt && ST_GeomFromText('POLYGON((-98.5 32,-98.5 39,-91.5 39,-91.5 32,-98.5 32))',find_srid('','wmstest','pt')); +select 'MapServer4', "id",substr(encode(ST_AsBinary(ST_ForceCollection(ST_Force2d("pt")),'NDR'),'hex'),0,16) as geom,"id" from wmstest where pt && ST_GeomFromText('POLYGON((-98.5 32,-98.5 39,-91.5 39,-91.5 32,-98.5 32))',find_srid('','wmstest','pt')); -- Drop the data table SELECT 'Removing the data table...'; DROP TABLE wmstest; --DELETE FROM geometry_columns WHERE f_table_name = 'wmstest' AND f_table_schema = 'public'; -SELECT 'Done.'; \ No newline at end of file +SELECT 'Done.';