From ce0891960e0f63419f193e44214b7f11a1f29fe6 Mon Sep 17 00:00:00 2001 From: Regina Obe Date: Tue, 22 Jul 2008 11:12:32 +0000 Subject: [PATCH] move over ST_SetSRID, ST_Transform and ST_Multi. Provide examples. git-svn-id: http://svn.osgeo.org/postgis/trunk@2874 b70326c6-7e19-0410-871a-916f4a2858ee --- doc/reference.xml | 28 +--------- doc/reference_new.xml | 127 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 128 insertions(+), 27 deletions(-) diff --git a/doc/reference.xml b/doc/reference.xml index 0eaf061af..3c8db58cb 100644 --- a/doc/reference.xml +++ b/doc/reference.xml @@ -1750,24 +1750,7 @@ SELECT sometable.field1, sometable.field1, - - ST_Multi(geometry) - - - Returns the geometry as a MULTI* geometry. If the geometry - is already a MULTI*, it is returned unchanged. - - - - - ST_Transform(geometry,integer) - - - Returns a new geometry with its coordinates transformed to - the SRID referenced by the integer parameter. The destination SRID - must exist in the SPATIAL_REF_SYS table. - - + ST_Affine(geometry, float8, float8, float8, float8, float8, @@ -2948,16 +2931,7 @@ WHERE n*100.00/length < 1; - - ST_Transform - - Return an ST_Geometry value transformed to the specified - spatial reference system. - - SQL-MM 3: 5.1.6 - - ST_Union diff --git a/doc/reference_new.xml b/doc/reference_new.xml index e2a2d9cff..6131e3252 100644 --- a/doc/reference_new.xml +++ b/doc/reference_new.xml @@ -1094,6 +1094,133 @@ LINESTRING(1 2,1 10) | LINESTRING(1 10,1 2) + + + + ST_Multi + + Returns the geometry as a MULTI* geometry. If the geometry + is already a MULTI*, it is returned unchanged. + + + + + + geoometry ST_Multi + geometry g1 + + + + + + Description + + Returns the geometry as a MULTI* geometry. If the geometry + is already a MULTI*, it is returned unchanged. + + + + + Examples + + SELECT ST_AsText(ST_Multi(ST_GeomFromText('POLYGON((743238 2967416,743238 2967450, + 743265 2967450,743265.625 2967416,743238 2967416))'))); + st_astext + -------------------------------------------------------------------------------------------------- + MULTIPOLYGON(((743238 2967416,743238 2967450,743265 2967450,743265.625 2967416, + 743238 2967416))) + (1 row) + + + + See Also + + + + + + + ST_Transform + + Returns a new geometry with its coordinates transformed to + the SRID referenced by the integer parameter. + + + + + + geometry ST_Transform + geometry g1 + integer srid + + + + + + Description + + Returns a new geometry with its coordinates transformed to + spatial reference system referenced by the SRID integer parameter. The destination SRID + must exist in the SPATIAL_REF_SYS table. + ST_Transform is often confused with ST_SetSRID(). ST_Transform actually changes the coordinates + of a geometry from one spatial reference system to another, while ST_SetSRID() simply changes the SRID identifier of + the geometry + + + If using more than one transformation, it is useful to have a functional index on the commonly used + transformations to take advantage of index usage. + + + + + + + + This method implements the OpenGIS Simple Features + Implementation Specification for SQL. + + + + + + + This method implements the SQL/MM specification: + SQL-MM 3: 5.1.6 + + + + Examples + Change Mass state plane US feet geometry to WGS 84 long lat + + SELECT ST_AsText(ST_Transform(ST_GeomFromText('POLYGON((743238 2967416,743238 2967450, + 743265 2967450,743265.625 2967416,743238 2967416))',2249),4326)) As wgs_geom; + + wgs_geom +--------------------------- + POLYGON((-71.1776848522251 42.3902896512902,-71.1776843766326 42.3903829478009, +-71.1775844305465 42.3903826677917,-71.1775825927231 42.3902893647987,-71.177684 +8522251 42.3902896512902)); +(1 row) + + Example of creating a partial functional index. For tables where you are not sure all the geometries + will be filled in, its best to use a partial index that leaves out null geometries which will both conserve space and make your index smaller and more efficient. + +CREATE INDEX idx_the_geom_26986_parcels + ON parcels + USING gist + (ST_Transform(the_geom, 26986)) + WHERE the_geom IS NOT NULL; + + + + + + See Also + + , , + + -- 2.50.1