raster_polygon
Functions for computing and adding boundary polygon to geo_runconfig dicts
get_boundary_polygon(filename, invalid_value=np.nan, dataset_path_template=None)
Get boundary polygon for raster in 'filename'. Polygon includes only valid pixels
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
Path to GDAL friendly file containing geocoded raster |
required | |
invalid_value
|
Invalid data value for raster in 'filename' |
nan
|
|
dataset_path_template
|
Template string with place holder string, %FILE_PATH%, to be replace by actual path containing dataset. Will only be used if not None. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
poly |
Polygon
|
Shapely polygon including valid values |
Source code in src/compass/utils/raster_polygon.py
11 12 13 14 15 16 17 18 19 20 21 22 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 61 62 63 | |