[postgis-users] How to Subtract Polygon From Polygon

Maxime van Noppen maxime at altribe.org
Tue Nov 2 06:01:09 PDT 2010


On 11/02/2010 01:48 PM, Jan Saalbach wrote:
> Dear All,
> is there a function to easily subtract a polygon from a polygon. Both
> are rectangles.
> 
> The scenario:
> Two overlapping polygons identified by ST_INTERSECTS.
> Creating a third one from the overlapping area via ST_INTERSECTION.
> Subtract the overlap from the two initial polygons. Which function?
> 
> Any suggestions?
> 
> Regards
> Jan

Hi,

ST_Difference does the trick.

http://postgis.refractions.net/docs/ST_Difference.html

-- 
Maxime



More information about the postgis-users mailing list