geo-registry

Clip

Cuts vector features to the area of a mask layer, keeping only the parts inside it.

Pitfall. Attributes such as lengths and areas are copied, not recalculated, for the clipped parts.
About this operation
Also called Pairwise Clip, cookie cutter, extract by polygon
Group vector/overlay
Checks crs.agreement, geometry.valid, extent.plausible
Pitfalls 1 listed above
Columbus tool vector_op · clip
Notes Not stated
Status active
Broader Not stated
Narrower Not stated
Related

Parameters

Not stated

Inputs and outputs

Direction Name Type Geometry Note
Input layer vector Not stated Not stated
Input mask vector polygon Not stated
Output output vector Not stated Not stated

In each engine

Engine Tool Parameters Differences
dask-geopandas dask_geopandas.clip
  • layer → gdf
  • mask → mask
  • Lazy: works on a dask GeoDataFrame and returns one; call compute() for the result.
  • The mask must be an ordinary GeoDataFrame, GeoSeries or geometry, not a dask one.
gdal gdal vector clip
  • layer → input
  • mask → like
  • output → output
  • Can also clip to a bbox or to a geometry given as WKT, instead of a mask layer.
geopandas geopandas.clip
  • layer → gdf
  • mask → mask
  • The mask may also be a shapely geometry or a bounding box.
grass v.clip
  • layer → input
  • mask → clip
  • output → output
None noted
postgis st_intersection
  • layer → geom1
  • mask → geom2
  • Per pair of geometries: union the mask first, or join on ST_Intersects and intersect each pair.
qgis native:clip
  • layer → INPUT
  • mask → OVERLAY
  • output → OUTPUT
None noted
sf sf::st_intersection
  • layer → x
  • mask → y
  • Adds y's attributes to the result (a clip keeps only x's); drop them afterwards. st_crop cuts to a bounding box instead.
shapely shapely.intersection
  • layer → a
  • mask → b
  • Per pair of geometries (or element by element in arrays): union the mask first to cut by all of it.
terra terra::crop
  • layer → x
  • mask → y
  • Keeps only x's attributes; y can also be an extent.
whiteboxtools Clip
  • layer → input
  • mask → clip
  • output → output
None noted