eogrow.core.area.base
Implementation of the base AreaManager.
- pydantic model eogrow.core.area.base.PatchListSchema[source]
Bases:
SchemaCreate a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
- Fields:
- field filename: str [Required]
A JSON file containing a list of EOPatch names.
- Constraints:
pattern = ^.+.(json|JSON)$
- field input_folder_key: str [Required]
The storage manager key pointing to the folder containing the file.
- class eogrow.core.area.base.BaseAreaManager(config, storage)[source]
Bases:
EOGrowObjectA manager for the AOI and how it is split into EOPatches
- Parameters:
config (Schema) – The configuration schema
storage (StorageManager) – An instance of StorageManager class
- NAME_COLUMN = 'eopatch_name'
- pydantic model Schema[source]
Bases:
ManagerSchemaCreate a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
- Fields:
patch_names (eogrow.core.area.base.PatchListSchema | None)
- field patch_names: PatchListSchema | None = None
Names of EOPatches to keep when filtering in the get_grid method.
- abstract get_area_geometry(*, crs=CRS.WGS84)[source]
Provides a dissolved geometry object of the entire AOI
- Parameters:
crs (CRS) –
- Return type:
Geometry
- get_grid(filtered=True)[source]
Provides a grid of bounding boxes which divide the AOI. Uses caching to avoid recalculations.
The grid is split into different CRS zones. The bounds properties of the geometries are taken as BBox definitions. EOPatch names are stored in a column with identifier self.NAME_COLUMN.
- Returns:
A dictionary of GeoDataFrames that defines how the area is split into EOPatches.
- Parameters:
filtered (bool) –
- Return type:
dict[sentinelhub.constants.CRS, geopandas.geodataframe.GeoDataFrame]
- eogrow.core.area.base.get_geometry_from_file(filesystem, file_path, geopandas_engine='fiona')[source]
Provides a single geometry object of entire AOI
- Parameters:
filesystem (FS) –
file_path (str) –
geopandas_engine (Literal['fiona', 'pyogrio']) –
- Return type:
Geometry
- eogrow.core.area.base.load_grid(grid_path, storage)[source]
A method that loads the bounding box grid from the cache folder.
- Parameters:
grid_path (str) –
storage (StorageManager) –
- Return type:
dict[sentinelhub.constants.CRS, geopandas.geodataframe.GeoDataFrame]
- eogrow.core.area.base.save_grid(grid, grid_path, storage)[source]
A method that saves the bounding box grid to the cache folder.
- Parameters:
grid (dict[sentinelhub.constants.CRS, geopandas.geodataframe.GeoDataFrame]) –
grid_path (str) –
storage (StorageManager) –
- Return type:
None