Skip to main content
Clip geometries to a polygonal or rectangular mask. Distributed GeoSeries and GeoDataFrame masks are dissolved on the cluster before clipping. A four-value list-like mask is interpreted as (minx, miny, maxx, maxy). Both distributed layers should use the same Coordinate Reference System (CRS); a mismatch emits a warning.

Signature

Parameters

GeoDataFrame, GeoSeries, Polygon, MultiPolygon, or list-like
required
Polygonal mask, or four rectangle bounds. Distributed masks are dissolved into one geometry using ST_Union_Aggr.
bool
default:"False"
If True, retain only the input geometry family when clipping creates lower-dimensional geometries.
bool
default:"False"
If True, return matching rows in their original positional order.

Returns

GeoDataFrame or GeoSeries
Clipped data of the same type as the caller. Index values, non-geometry columns, active geometry, CRS, and SRID are preserved.
See also
  • GeoSeries.clip_by_rect
  • geopandas.clip
Sedona does not expose a separate fast ClipByBox operation. Four-value rectangle masks therefore use native ST_MakeEnvelope and ST_Intersection. Boundary-only intersections can consequently differ from GeoPandas’ fast, possibly dirty rectangle path.

Examples

Rectangle bounds can be supplied directly: