Skip to main content

Module intersection

Module intersection 

Source
Expand description

ST_Intersection — compute the area shared by two geometries.

Uses Sutherland-Hodgman polygon clipping for polygon-polygon intersection. For other geometry type combinations, delegates to simpler cases or returns empty geometry.

Sutherland-Hodgman works correctly for convex clipping polygons. For concave clip polygons, the result may include extra edges — this is a known limitation shared by most lightweight GIS implementations. Full Weiler-Atherton is needed for perfect concave-concave intersection but adds significant complexity. Sutherland-Hodgman covers the vast majority of practical use cases (convex query regions, rectangular bboxes, etc.).

Reference: Sutherland & Hodgman, “Reentrant Polygon Clipping” (1974)

Functions§

st_intersection
ST_Intersection(a, b) — return the geometry representing the shared area.