12.07.2015 Views

PostGIS 1.5.8 Manual - Fedora Project Packages GIT repositories

PostGIS 1.5.8 Manual - Fedora Project Packages GIT repositories

PostGIS 1.5.8 Manual - Fedora Project Packages GIT repositories

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>PostGIS</strong> <strong>1.5.8</strong> <strong>Manual</strong>236 / 310Performed by the GEOS module.NOTE: this function was formerly called GeomUnion(), which was renamed from "Union" because UNION is an SQL reservedword.Availability: 1.4.0 - ST_Union was enhanced. ST_Union(geomarray) was introduced and also faster aggregate collection in PostgreSQL.If you are using GEOS 3.1.0+ ST_Union will use the faster Cascaded Union algorithm described in http://blog.cleverelephant.ca/2009/01/must-faster-unions-in-postgis-14.htmlThis method implements the OpenGIS Simple Features Implementation Specification for SQL 1.1. s2.1.1.3NoteAggregate version is not explicitly defined in OGC SPEC.This method implements the SQL/MM specification. SQL-MM 3: 5.1.19 the z-index (elevation) when polygons areinvolved.ExamplesAggregate exampleSELECT stusps,ST_Multi(ST_Union(f.the_geom)) as singlegeomFROM sometable As fGROUP BY stuspsNon-Aggregate exampleSELECT ST_AsText(ST_Union(ST_GeomFromText(’POINT(1 2)’),ST_GeomFromText(’POINT(-2 3)’) ) )st_astext----------MULTIPOINT(-2 3,1 2)SELECT ST_AsText(ST_Union(ST_GeomFromText(’POINT(1 2)’),ST_GeomFromText(’POINT(1 2)’) ) );st_astext----------POINT(1 2)--3d example - sort of supports 3d (and with mixed dimensions!)SELECT ST_AsEWKT(st_union(the_geom))FROM(SELECT ST_GeomFromEWKT(’POLYGON((-7 4.2,-7.1 4.2,-7.1 4.3,-7 4.2))’) as the_geomUNION ALLSELECT ST_GeomFromEWKT(’POINT(5 5 5)’) as the_geomUNION ALLSELECT ST_GeomFromEWKT(’POINT(-2 3 1)’) as the_geomUNION ALLSELECT ST_GeomFromEWKT(’LINESTRING(5 5 5, 10 10 10)’) as the_geom ) as foo;st_asewkt---------

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!