- 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.
example, the commands are like:</para>
<programlisting>SELECT AddGeometryColumn('myschema','mytable','bbox','4326','GEOMETRY','2');
-UPDATE mytable SET bbox = ST_Envelope(ST_Force_2d(the_geom));</programlisting>
+UPDATE mytable SET bbox = ST_Envelope(ST_Force2D(the_geom));</programlisting>
<para>Now change your query to use the && operator against bbox
instead of geom_column, like:</para>
<para>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:</para>
- <programlisting>UPDATE mytable SET the_geom = ST_Force_2d(the_geom);
+ <programlisting>UPDATE mytable SET the_geom = ST_Force2D(the_geom);
VACUUM FULL ANALYZE mytable;</programlisting>
<para>Note that if you added your geometry column using
<refentry id="ST_Force_2D">
<refnamediv>
- <refname>ST_Force_2D</refname>
+ <refname>ST_Force2D</refname>
<refpurpose>Forces the geometries into a "2-dimensional mode" so that
all output representations will only have the X and Y coordinates.</refpurpose>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
- <funcdef>geometry <function>ST_Force_2D</function></funcdef>
+ <funcdef>geometry <function>ST_Force2D</function></funcdef>
<paramdef><type>geometry </type> <parameter>geomA</parameter></paramdef>
</funcprototype>
</funcsynopsis>
specifies 2-D geometries).</para>
<para>Enhanced: 2.0.0 support for Polyhedral surfaces was introduced.</para>
+ <para>Changed: 2.1.0. Up to 2.0.x this was called ST_Force_2D.</para>
<para>&curve_support;</para>
<para>&P_support;</para>
<para>&Z_support;</para>
<refsection>
<title>Examples</title>
- <programlisting>SELECT ST_AsEWKT(ST_Force_2D(ST_GeomFromEWKT('CIRCULARSTRING(1 1 2, 2 3 2, 4 5 2, 6 7 2, 5 6 2)')));
+ <programlisting>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
----------------------------------------------
<refentry id="ST_Force_3D">
<refnamediv>
- <refname>ST_Force_3D</refname>
+ <refname>ST_Force3D</refname>
- <refpurpose>Forces the geometries into XYZ mode. This is an alias for ST_Force_3DZ.</refpurpose>
+ <refpurpose>Forces the geometries into XYZ mode. This is an alias for ST_Force3DZ.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
- <funcdef>geometry <function>ST_Force_3D</function></funcdef>
+ <funcdef>geometry <function>ST_Force3D</function></funcdef>
<paramdef><type>geometry </type> <parameter>geomA</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>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.</para>
<para>Enhanced: 2.0.0 support for Polyhedral surfaces was introduced.</para>
+ <para>Changed: 2.1.0. Up to 2.0.x this was called ST_Force_3D.</para>
<para>&P_support;</para>
<para>&curve_support;</para>
<para>&Z_support;</para>
<programlisting>
--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
--------------------------------------------------------------
<refentry id="ST_Force_3DZ">
<refnamediv>
- <refname>ST_Force_3DZ</refname>
+ <refname>ST_Force3DZ</refname>
- <refpurpose>Forces the geometries into XYZ mode. This is a synonym for ST_Force_3D.</refpurpose>
+ <refpurpose>Forces the geometries into XYZ mode. This is a synonym for ST_Force3D.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
- <funcdef>geometry <function>ST_Force_3DZ</function></funcdef>
+ <funcdef>geometry <function>ST_Force3DZ</function></funcdef>
<paramdef><type>geometry </type> <parameter>geomA</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<refsection>
<title>Description</title>
- <para>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.</para>
+ <para>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.</para>
<para>Enhanced: 2.0.0 support for Polyhedral surfaces was introduced.</para>
+ <para>Changed: 2.1.0. Up to 2.0.x this was called ST_Force_3DZ.</para>
<para>&P_support;</para>
<para>&Z_support;</para>
<para>&curve_support;</para>
<programlisting>
--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
--------------------------------------------------------------
<refentry id="ST_Force_3DM">
<refnamediv>
- <refname>ST_Force_3DM</refname>
+ <refname>ST_Force3DM</refname>
<refpurpose>Forces the geometries into XYM mode.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
- <funcdef>geometry <function>ST_Force_3DM</function></funcdef>
+ <funcdef>geometry <function>ST_Force3DM</function></funcdef>
<paramdef><type>geometry </type> <parameter>geomA</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>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</para>
+ <para>Changed: 2.1.0. Up to 2.0.x this was called ST_Force_3DM.</para>
<para>&curve_support;</para>
</refsection>
<programlisting>
--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
---------------------------------------------------------------
<refentry id="ST_Force_4D">
<refnamediv>
- <refname>ST_Force_4D</refname>
+ <refname>ST_Force4D</refname>
<refpurpose>Forces the geometries into XYZM mode. </refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
- <funcdef>geometry <function>ST_Force_4D</function></funcdef>
+ <funcdef>geometry <function>ST_Force4D</function></funcdef>
<paramdef><type>geometry </type> <parameter>geomA</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>Forces the geometries into XYZM mode. 0 is tacked on for missing Z and M dimensions. </para>
+ <para>Changed: 2.1.0. Up to 2.0.x this was called ST_Force_4D.</para>
<para>&Z_support;</para>
<para>&curve_support;</para>
</refsection>
<programlisting>
--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
--------------------------------------------------------------------------------------
<refentry id="ST_Force_Collection">
<refnamediv>
- <refname>ST_Force_Collection</refname>
+ <refname>ST_ForceCollection</refname>
<refpurpose>Converts the geometry into a GEOMETRYCOLLECTION.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
- <funcdef>geometry <function>ST_Force_Collection</function></funcdef>
+ <funcdef>geometry <function>ST_ForceCollection</function></funcdef>
<paramdef><type>geometry </type> <parameter>geomA</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>Enhanced: 2.0.0 support for Polyhedral surfaces was introduced.</para>
<para>Availability: 1.2.2, prior to 1.3.4 this function will crash with Curves. This is fixed in 1.3.4+</para>
+ <para>Changed: 2.1.0. Up to 2.0.x this was called ST_Force_Collection.</para>
<para>&P_support;</para>
<para>&Z_support;</para>
<programlisting>
-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))
<programlisting>
-- 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)),
------------------------------------------------------------------------
-- 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
-- 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)
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;
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));
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))'));
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;
-- 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)
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.';