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: eolearn.io.geometry_io._BaseVectorImportTask

A task for importing (Fiona readable) vector data files into an EOPatch

Parameters
  • feature ((FeatureType, str)) – 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, default = True) – Should the geometries be transformed to coordinate reference system of the requested bbox?

  • clip (bool, default = False) – Should the geometries be clipped to the requested bbox, or should be geometries kept as they are?

  • filesystem (fs.base.FS or None) – A filesystem object. If not given it will be created from the path and config credentials.

  • config (SHConfig) – A configuration object with AWS credentials (if not provided, ~/.aws/credentials will be used)

  • kwargs – Additional args that will be passed to fiona.open or geopandas.read calls (e.g. layer name)

property aws_session

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

Return type

AWSSession

property dataset_crs

Provides a CRS of dataset, it loads it lazily (i.e. the first time it is needed)

Returns

Dataset’s CRS

Return type

CRS

class eolearn.io.geometry_io.GeopediaVectorImportTask(feature, geopedia_table, reproject=True, clip=False, **kwargs)[source]

Bases: eolearn.io.geometry_io._BaseVectorImportTask

A task for importing Geopedia features into EOPatch vector features

Parameters
  • feature ((FeatureType, str)) – A vector feature into which to import data

  • geopedia_table (str or int) – A Geopedia table from which to retrieve features

  • reproject (bool, default = True) – Should the geometries be transformed to coordinate reference system of the requested bbox?

  • clip (bool, default = False) – Should the geometries be clipped to the requested bbox, or should be geometries kept as they are?

  • kwargs – Additional args that will be passed to GeopediaFeatureIterator