[postgis-users] getting different geometries with geomunion()

Hentschel, Markus Markus.Hentschel at lk-nvp.de
Thu Jul 13 02:59:05 PDT 2006


Hi everyone,

can't find a solution in the archive, but maybe somebody asked this before:

With GeomUnion postgis returns one single geometry. In my case the returned geometry is a multipolygon containing multiple geometries which don't adjoin. Is it possible to get one polygon for each area? Unfortunately there is no attribute to group by. The only attribute is the geometry, but I can't use the aggregated the_geom in the GROUP BY clause.

For example, if you have a polygon database of all states of the US and your statement is this:

SELECT geomunion(the_geom)
FROM states
WHERE name like 'I%'

the result would be *one* multipolygon containing Illinois and Indiana, but also Idaho. How can you get seperated polygons containing only the respectively adjacent geometries?  

thanks and greetings

Markus



____________
Virus checked by G DATA AntiVirusKit
Version: AVK 16.7985 from 19.06.2006
Virus news: www.antiviruslab.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20060713/b651f427/attachment.html>


More information about the postgis-users mailing list