geoutils.Vector.crop#
- Vector.crop(crop_geom, clip=False, *, inplace=False)[source]#
Crop the vector to given extent.
Match-reference: a reference raster or vector can be passed to match bounds during cropping.
Optionally, clip geometries to that extent (by default keeps all intersecting).
Reprojection is done on the fly if georeferenced objects have different projections.
- Parameters:
crop_geom (
Raster
|Vector
|list
[float
] |tuple
[float
,...
]) – Geometry to crop vector to, as either a Raster object, a Vector object, or a list of coordinates. Ifcrop_geom
is a raster or a vector, will crop to the bounds. Ifcrop_geom
is a list of coordinates, the order is assumed to be [xmin, ymin, xmax, ymax].clip (
bool
) – Whether to clip the geometry to the given extent (by default keeps all intersecting).inplace (
bool
) – Whether to update the vector in-place.
- Return type:
- Returns:
Cropped vector (or None if inplace).