ProcessArea
dataclass
Bases: Iterable[Coordinates]
A process area specifies the area of interest by a set of coordinates of the bottom left corner of each tile.
Notes
- The + operator can be used to add two process areas
- The - operator can be used to subtract two process areas
ATTRIBUTE | DESCRIPTION |
---|---|
coordinates |
coordinates (x_min, y_min) of each tile
TYPE:
|
coordinates: CoordinatesSet
property
writable
RETURNS | DESCRIPTION |
---|---|
CoordinatesSet
|
coordinates (x_min, y_min) of each tile |
from_bounding_box
classmethod
Creates a process area from a bounding box.
PARAMETER | DESCRIPTION |
---|---|
bounding_box |
bounding box
TYPE:
|
tile_size |
tile size in meters
TYPE:
|
quantize |
if True, the bounding box is quantized to
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
ProcessArea
|
process area |
from_gdf
classmethod
Creates a process area from a geodataframe.
PARAMETER | DESCRIPTION |
---|---|
gdf |
geodataframe
TYPE:
|
tile_size |
tile size in meters
TYPE:
|
quantize |
if True, the bounding box is quantized to
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
ProcessArea
|
process area |
from_json
classmethod
Creates a process area from a JSON string.
Notes
- The JSON string contains a list of coordinates (x_min, y_min) of each tile
Examples:
Assume the JSON string is '[[363084, 5715326], [363212, 5715326], [363084, 5715454], [363212, 5715454]]'.
You can create a process area from the JSON string.
>>> process_area = ProcessArea.from_json(
... json_string= (
... '[[363084, 5715326], '
... '[363212, 5715326], '
... '[363084, 5715454], '
... '[363212, 5715454]]'
... ),
... )
PARAMETER | DESCRIPTION |
---|---|
json_string |
JSON string
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
ProcessArea
|
process area |
from_config
classmethod
Creates a process area from the configuration.
PARAMETER | DESCRIPTION |
---|---|
config |
configuration
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
ProcessArea
|
process area |
RAISES | DESCRIPTION |
---|---|
AviaryUserError
|
Invalid configuration |
append
Appends the coordinates.
PARAMETER | DESCRIPTION |
---|---|
other |
other coordinates
TYPE:
|
inplace |
if True, the coordinates are appended inplace
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
ProcessArea
|
process area |
chunk
Chunks the coordinates.
PARAMETER | DESCRIPTION |
---|---|
num_chunks |
number of chunks
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
list[ProcessArea]
|
list of process areas |
filter
Filters the coordinates.
PARAMETER | DESCRIPTION |
---|---|
coordinates_filter |
coordinates filter
TYPE:
|
inplace |
if True, the coordinates are filtered inplace
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
ProcessArea
|
filtered process area |
to_gdf
Converts the coordinates to a geodataframe.
PARAMETER | DESCRIPTION |
---|---|
epsg_code |
EPSG code
TYPE:
|
tile_size |
tile size in meters
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
gpd.GeoDataFrame
|
geodataframe |
RAISES | DESCRIPTION |
---|---|
AviaryUserError
|
Invalid tile size ( |
to_json
Converts the coordinates to a JSON string.
Notes
- The JSON string contains a list of coordinates (x_min, y_min) of each tile
RETURNS | DESCRIPTION |
---|---|
str
|
JSON string |
ProcessAreaConfig
Bases: pydantic.BaseModel
Configuration for the from_config
class method of ProcessArea
The configuration must have one of the following field sets
json_string
gdf
andtile_size
bounding_box
andtile_size
ATTRIBUTE | DESCRIPTION |
---|---|
bounding_box |
bounding box (x_min, y_min, x_max, y_max)
TYPE:
|
gdf |
path to the geodataframe
TYPE:
|
json_string |
path to the JSON file containing the coordinates (x_min, y_min) of each tile
TYPE:
|
processed_coordinates_json_string |
path to the JSON file containing the coordinates (x_min, y_min) of the processed tiles
TYPE:
|
tile_size |
tile size in meters
TYPE:
|
quantize |
if True, the bounding box is quantized to
TYPE:
|