lair.inventories.Vulcan.clip#

Vulcan.clip(bbox=None, extent=None, geom=None, crs=None, inplace=False, **kwargs)[source]#

Clip the data to the given bounds.

Input bounds must be in the same CRS as the data.

Note

The result can be slightly different between supplying a geom and a bbox/extent. Clipping with a geom seems to be exclusive of the bounds, while clipping with a bbox/extent seems to be inclusive of the bounds.

Parameters:
  • bbox (tuple[minx, miny, maxx, maxy]) – The bounding box to clip the data to.

  • extent (tuple[minx, maxx, miny, maxy]) – The extent to clip the data to.

  • geom (shapely.Polygon) – The geometry to clip the data to.

  • crs (Any) – The CRS of the input geometries. If not provided, the CRS of the data is used.

  • inplace (bool, optional) – Whether to modify the data in place. Default is False (returns a new, clipped inventory).

  • kwargs (Any) – Additional keyword arguments to pass to the rioxarray clip method.

Returns:

Vulcan – The clipped inventory.

Return type:

Self

See also

Vulcan.reproject

Needs the data clipped first.