Clipping
clip_raster(raster, geodataframe)
Clips a raster with polygon geometries.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
raster |
DatasetReader
|
The raster to be clipped. |
required |
geodataframe |
GeoDataFrame
|
A geodataframe containing the geometries to do the clipping with. Should contain only polygon features. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
The clipped raster data. |
dict
|
The updated metadata. |
Raises:
Type | Description |
---|---|
NonMatchingCrsException
|
The raster and geodataframe are not in the same CRS. |
GeometryTypeException
|
The input geometries contain non-polygon features. |
Source code in eis_toolkit/raster_processing/clipping.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
|