IDW
idw(geodataframe, target_column, resolution, extent=None, power=2)
Calculate inverse distance weighted (IDW) interpolation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
geodataframe |
GeoDataFrame
|
The vector dataframe to be interpolated. |
required |
target_column |
str
|
The column name with values for each geometry. |
required |
resolution |
Tuple[Number, Number]
|
The resolution i.e. cell size of the output raster as (pixel_size_x, pixel_size_y). |
required |
extent |
Optional[Tuple[Number, Number, Number, Number]]
|
The extent of the output raster as (x_min, x_max, y_min, y_max). If None, calculate extent from the input vector data. |
None
|
power |
Number
|
The value for determining the rate at which the weights decrease. As power increases, the weights for distant points decrease rapidly. Defaults to 2. |
2
|
Returns:
Type | Description |
---|---|
Tuple[ndarray, dict]
|
Rasterized vector data and metadata. |
Raises:
Type | Description |
---|---|
EmptyDataFrameException
|
The input GeoDataFrame is empty. |
InvalidParameterValueException
|
Invalid resolution or target_column. |
Source code in eis_toolkit/vector_processing/idw_interpolation.py
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 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
|