From: Regina Obe Date: Mon, 30 Jun 2008 15:34:38 +0000 (+0000) Subject: Same changes as in trunk X-Git-Tag: 1.3.4rc1~54 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=324305e55b8eb7c87dee34d2f248f7176ae41239;p=postgis Same changes as in trunk git-svn-id: http://svn.osgeo.org/postgis/branches/1.3@2818 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/doc/postgis.xml b/doc/postgis.xml index e628bcc5a..e17360be9 100644 --- a/doc/postgis.xml +++ b/doc/postgis.xml @@ -3181,8 +3181,8 @@ VACUUM FULL ANALYZE mytable; It is usually used with MULTI and Geometry Collections. Although it is not an aggregate - you can use it in conjunction with ST_Collect to get the convex hull of a set of points. ST_ConvexHull(ST_Collect(somepointfield)). It is often used to determine an affected area based on a set of point observations. SELECT d.disease_type, ST_ConvexHull(ST_Collect(d.the_geom)) As the_geom - FROM disease_obs As d - GROUP BY d.disease_type + FROM disease_obs As d + GROUP BY d.disease_type Performed by the GEOS module @@ -3218,8 +3218,8 @@ VACUUM FULL ANALYZE mytable; ST_SymDifference(geometry A, geometry B) - Returns a geometry that represents the point set symmetric - difference of Geometry A with Geometry B. + Returns a geometry that represents the portions of A and B that do not intersect. It is + called a symmetric difference because ST_SymDifference(A,B) = ST_SymDifference(B,A). Performed by the GEOS module @@ -3233,8 +3233,8 @@ VACUUM FULL ANALYZE mytable; ST_Difference(geometry A, geometry B) - Returns a geometry that represents the point set - difference of Geometry A with Geometry B. + Returns a geometry that represents that part of geometry A that does not intersect + with geometry B. Performed by the GEOS module @@ -4619,11 +4619,27 @@ dimension This function returns a GEOMETRYCOLLECTION or a MULTI object from a set of geometries. The collect() function is an "aggregate" function in the terminology of PostgreSQL. - That means that it operators on lists of data, in the same way + That means that it operates on rows of data, in the same way the sum() and mean() functions do. For example, "SELECT COLLECT(GEOM) FROM GEOMTABLE GROUP BY ATTRCOLUMN" will return a separate GEOMETRYCOLLECTION for each distinct value of ATTRCOLUMN. + ST_Collect and ST_Union are often interchangeable. + ST_Collect is in general orders of magnitude faster than ST_Union because it does not try to dissolve + boundaries. It merely rolls up single geometries into MULTI and MULTI or mixed geometry types into Geometry Collections. + Unfortunately geometry collections are not well-supported by + GIS tools. To prevent ST_Collect from returning a Geometry Collection when collecting MULTI geometries, + one can use the below trick that utilizes ST_Dump to expand the MULTIs out to singles and then regroup them. + + +Thread ref: http://postgis.refractions.net/pipermail/postgis-users/2008-June/020331.html +SELECT stusps, + ST_Multi(ST_Collect(f.the_geom)) as singlegeom + FROM (SELECT stusps, (ST_Dump(the_geom)).geom As the_geom + FROM + somestatetable ) As f +GROUP BY stusps + @@ -4649,6 +4665,15 @@ dimension input geometry is a collection or multi it will return a record for each of the collection components, and the path will express the position of the component inside the collection. + + ST_Dump is useful for expanding geometries. It is the reverse of a GROUP BY in that + it creates new rows. For example it can be use to expand MULTIPOLYGONS into POLYGONS. + + +SELECT sometable.*, (ST_Dump(the_geom)).geom As the_geom + FROM somestatetable + + Availability: PostGIS 1.0.0RC1. Requires PostgreSQL 7.3 or higher. @@ -6160,7 +6185,7 @@ z' = z This method is a subcase of - Attach the patch to a new issue in bug tracker. + Attach the patch to a new issue in bug tracker.