Hi Brian,

> I have squares.  A lot of squares.  Thousands of squares.  I would
> love 
> to combine them into one or more larger polygons.  But, they must
> valid 
> polygons, non-reentrant.  For example. if you have a 3x3 grid of
> squares,
> ABC
> RST
> XYZ
> and I want to combine all but the center, I would need either 2
> polygons 
> (something like ABC and RXYZT), or one polygon with an inner ring.

Assuming there is a table 'squares' containing a geometry type 'the_geom', this 
one produces a polygon having an inner ring:

SELECT
ST_Difference(ST_Union(the_geom), (SELECT the_geom FROM squares WHERE id='S'))
FROM squares

Best Regards,
Andreas
_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to