Reclassify raster
reclassify_with_defined_intervals(raster, interval_size, bands=None)
Classify raster with defined intervals.
If bands are not given, all bands are used for classification.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
raster |
DatasetReader
|
Raster to be classified. |
required |
interval_size |
int
|
The number of units in each interval. |
required |
bands |
Optional[Sequence[int]]
|
Selected bands from multiband raster. Indexing begins from one. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
ndarray
|
Raster data classified with defined intervals. |
dict
|
Raster metadata. |
Raises:
Type | Description |
---|---|
InvalidRasterBandException
|
All selected bands are not contained in the input raster. |
InvalidParameterValueException
|
Interval size is less than 1. |
Source code in eis_toolkit/raster_processing/reclassify.py
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 110 111 112 113 114 115 |
|
reclassify_with_equal_intervals(raster, number_of_intervals, bands=None)
Classify raster with equal intervals.
If bands are not given, all bands are used for classification.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
raster |
DatasetReader
|
Raster to be classified. |
required |
number_of_intervals |
int
|
The number of intervals. |
required |
bands |
Optional[Sequence[int]]
|
Selected bands from multiband raster. Indexing begins from one. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
ndarray
|
Raster data classified with equal intervals. |
dict
|
Raster metadata. |
Raises:
Type | Description |
---|---|
InvalidRasterBandException
|
All selected bands are not contained in the input raster. |
InvalidParameterValueException
|
Number of intervals is less than 2. |
Source code in eis_toolkit/raster_processing/reclassify.py
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
|
reclassify_with_geometrical_intervals(raster, number_of_classes, bands=None)
Classify raster with geometrical intervals.
If bands are not given, all bands are used for classification.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
raster |
DatasetReader
|
Raster to be classified. |
required |
number_of_classes |
int
|
The number of classes. The true number of classes is at most double the amount, depending how symmetrical the input data is. |
required |
bands |
Optional[Sequence[int]]
|
Selected bands from multiband raster. Indexing begins from one. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
ndarray
|
Raster data classified with geometrical intervals. |
dict
|
Raster metadata. |
Raises:
Type | Description |
---|---|
InvalidRasterBandException
|
All selected bands are not contained in the input raster. |
InvalidParameterValueException
|
Number of classes is less than 2. |
Source code in eis_toolkit/raster_processing/reclassify.py
343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 |
|
reclassify_with_manual_breaks(raster, breaks, bands=None)
Classify raster with manual breaks.
If bands are not given, all bands are used for classification.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
raster |
DatasetReader
|
Raster to be classified. |
required |
breaks |
Sequence[int]
|
List of break values for the classification. |
required |
bands |
Optional[Sequence[int]]
|
Selected bands from multiband raster. Indexing begins from one. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
ndarray
|
Raster data classified with manual breaks. |
dict
|
Raster metadata. |
Raises:
Type | Description |
---|---|
InvalidRasterBandException
|
All selected bands are not contained in the input raster. |
Source code in eis_toolkit/raster_processing/reclassify.py
23 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 60 |
|
reclassify_with_natural_breaks(raster, number_of_classes, bands=None)
Classify raster with natural breaks (Jenks Caspall).
If bands are not given, all bands are used for classification.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
raster |
DatasetReader
|
Raster to be classified. |
required |
number_of_classes |
int
|
The number of classes. |
required |
bands |
Optional[Sequence[int]]
|
Selected bands from multiband raster. Indexing begins from one. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
ndarray
|
Raster data classified with natural breaks (Jenks Caspall). |
dict
|
Raster metadata. |
Raises:
Type | Description |
---|---|
InvalidRasterBandException
|
All selected bands are not contained in the input raster. |
InvalidParameterValueException
|
Number of classes is less than 2. |
Source code in eis_toolkit/raster_processing/reclassify.py
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 |
|
reclassify_with_quantiles(raster, number_of_quantiles, bands=None)
Classify raster with quantiles.
If bands are not given, all bands are used for classification.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
raster |
DatasetReader
|
Raster to be classified. |
required |
number_of_quantiles |
int
|
The number of quantiles. |
required |
bands |
Optional[Sequence[int]]
|
Selected bands from multiband raster. Indexing begins from one. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
ndarray
|
Raster data classified with quantiles. |
dict
|
Raster metadata. |
Raises:
Type | Description |
---|---|
InvalidRasterBandException
|
All selected bands are not contained in the input raster. |
InvalidParameterValueException
|
Number of quantiles is less than 2. |
Source code in eis_toolkit/raster_processing/reclassify.py
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 |
|
reclassify_with_standard_deviation(raster, number_of_intervals, bands=None)
Classify raster with standard deviation.
If bands are not given, all bands are used for classification.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
raster |
DatasetReader
|
Raster to be classified. |
required |
number_of_intervals |
int
|
The number of intervals. |
required |
bands |
Optional[Sequence[int]]
|
Selected bands from multiband raster. Indexing begins from one. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
ndarray
|
Raster data classified with standard deviation. |
dict
|
Raster metadata. |
Raises:
Type | Description |
---|---|
InvalidRasterBandException
|
All selected bands are not contained in the input raster. |
InvalidParameterValueException
|
Number of intervals is less than 2. |
Source code in eis_toolkit/raster_processing/reclassify.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 |
|