Snapping
snap_with_raster(raster, snap_raster)
Snaps/aligns raster to given snap raster.
Raster is snapped from its left-bottom corner to nearest snap raster grid corner in left-bottom direction. If rasters are aligned, simply returns input raster data and metadata.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
raster |
DatasetReader
|
The raster to be clipped. |
required |
snap_raster |
DatasetReader
|
The snap raster i.e. reference grid raster. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
The snapped raster data. |
dict
|
The updated metadata. |
Raises:
Type | Description |
---|---|
NonMatchingCrsException
|
Raster and and snap raster are not in the same CRS. |
MatchingRasterGridException
|
Raster grids are already aligned. |
Source code in eis_toolkit/raster_processing/snapping.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
|