Skip to main content
Returns a GeoSeries of the portions of geometry within the given rectangle. The geometry is clipped to the rectangle defined by the given coordinates. Geometries that do not intersect the rectangle are returned as empty polygons (POLYGON EMPTY).
This implementation uses ST_Intersection with a rectangle envelope, which may produce slightly different results from geopandas’ clip_by_rect in edge cases: - Non-intersecting geometries are returned as POLYGON EMPTY, whereas geopandas returns GEOMETRYCOLLECTION EMPTY. - Points on the boundary of the rectangle are considered intersecting and are returned unchanged, whereas geopandas returns GEOMETRYCOLLECTION EMPTY for boundary-only intersections.

Signature

Parameters

float
required
Minimum x value of the rectangle.
float
required
Minimum y value of the rectangle.
float
required
Maximum x value of the rectangle.
float
required
Maximum y value of the rectangle.

Returns

GeoSeries
See also
  • GeoSeries.intersection

Examples

Geometries that do not intersect the rectangle are returned as empty: