Reprojecting
reproject_raster(raster, target_crs, resampling_method='nearest')
Reprojects raster to match given coordinate reference system (EPSG).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
raster |
DatasetReader
|
The raster to be reprojected. |
required |
target_crs |
int
|
Target CRS as EPSG code. |
required |
resampling_method |
Literal[nearest, bilinear, cubic, average, gauss, max, min]
|
Resampling method. Most suitable method depends on the dataset and context. Nearest, bilinear and cubic are some common choices. This parameter defaults to nearest. |
'nearest'
|
Returns:
Type | Description |
---|---|
ndarray
|
The reprojected raster data. |
dict
|
The updated metadata. |
Raises:
Type | Description |
---|---|
NonMatchinCrsException
|
Raster is already in the target CRS. |
Source code in eis_toolkit/raster_processing/reprojecting.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
|