Windowing
extract_window(raster, center_coords, height, width)
Extract window from raster.
Center coordinate must be inside the raster but window can extent outside the raster in which case padding with raster nodata value is used. Args: raster: Source raster. center_coords: Center coordinates for window in form (x, y). The coordinates should be in the raster's CRS. height: Window height in pixels. width: Window width in pixels.
Returns:
Type | Description |
---|---|
ndarray
|
The extracted raster window. |
dict
|
The updated metadata. |
Raises:
Type | Description |
---|---|
InvalidParameterValueException
|
Window size is too small. |
CoordinatesOutOfBoundException
|
Window center coordinates are out of raster bounds. |
Source code in eis_toolkit/raster_processing/windowing.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
|