eolearn.io.geometry_io
Module for adding vector data from various sources
- class eolearn.io.geometry_io.VectorImportTask(feature, path, reproject=True, clip=False, filesystem=None, config=None, **kwargs)[source]
Bases:
EOTask
A task for importing (Fiona readable) vector data files into an EOPatch
- Parameters:
feature (Feature) – A vector feature into which to import data
path (str) – A path to a dataset containing vector data. It can be either a local path or a path to s3 bucket. If filesystem parameter is given the path should be relative to the filesystem, otherwise it should be an absolute path.
reproject (bool) – Should the geometries be transformed to coordinate reference system of the requested bbox?
clip (bool) – Should the geometries be clipped to the requested bbox, or should be geometries kept as they are?
filesystem (FS | None) – A filesystem object. If not given it will be created from the path and config credentials.
config (SHConfig | None) – A configuration object with AWS credentials (if not provided, ~/.aws/credentials will be used)
kwargs (Any) – Additional args that will be passed to fiona.open or geopandas.read calls (e.g. layer name)
- property aws_session: AWSSession
Because the session object cannot be pickled this provides the session lazily (i.e. the first time it is needed)
- Returns:
A session for AWS services
- property dataset_crs: CRS
Provides a CRS of dataset, it loads it lazily (i.e. the first time it is needed)
- execute(eopatch=None, *, bbox=None)[source]
- Parameters:
eopatch (EOPatch | None) – An existing EOPatch. If none is provided it will create a new one.
bbox (BBox | None) – A bounding box for which to load data. By default, if none is provided, it will take a bounding box of given EOPatch. If given EOPatch is not provided it will load the entire dataset.
- Returns:
An EOPatch with an additional vector feature
- Return type: