[postgis-users] Merge rectangles

DrYSG ygutfreund at draper.com
Wed Aug 15 11:39:05 PDT 2012

In the table portal.catalog 

column poly is a geometry (always a rectangle, with datum EPSG 4326)
column type is a text field.

I want to find all the records who have a type of "CADRG" and merge the
polygons into the simplest shape that covers all the items in the array
(I.e. if they form a square with a hole, then I want that, if it has to be a
multipolygon, so be it).

Is this the correct way to do that?

SELECT ST_AsText(ST_Union(
	SELECT poly 
	FROM portal.catalog as cat
	WHERE cat.type='CADRG'

View this message in context: http://postgis.17.n6.nabble.com/Merge-rectangles-tp4999357.html
Sent from the PostGIS - User mailing list archive at Nabble.com.

More information about the postgis-users mailing list