EOProduct
Contents
EOProduct#
Constructor#
|
A wrapper around an Earth Observation Product originating from a search. |
Download#
|
Download the EO product using the provided download plugin and the authenticator if necessary. |
|
Download the quicklook image of a given EOProduct from its provider if it exists. |
Conversion#
Builds a representation of EOProduct as a dictionary to enable its geojson serialization |
|
|
Builds an |
Interface#
Builds a representation of EOProduct as a dictionary to enable its geojson serialization |
- class eodag.api.product._product.EOProduct(provider, properties, **kwargs)[source]#
A wrapper around an Earth Observation Product originating from a search.
Every Search plugin instance must build an instance of this class for each of the result of its query method, and return a list of such instances. A EOProduct has a location attribute that initially points to its remote location, but is later changed to point to its path on the filesystem when the product has been downloaded. It also has a remote_location that always points to the remote location, so that the product can be downloaded at anytime if it is deleted from the filesystem. An EOProduct instance also has a reference to the search parameters that led to its creation.
- Parameters
- Variables
product_type (str) – The product type
location (str) – The path to the product, either remote or local if downloaded
remote_location (str) – The remote path to the product
search_kwargs (Any) – The search kwargs used by eodag to search for the product
geometry (
shapely.geometry.base.BaseGeometry
) – The geometry of the productsearch_intersection (
shapely.geometry.base.BaseGeometry
or None) – The intersection between the product’s geometry and the search area.
Note
The geojson spec enforces the expression of geometries as WGS84 CRS (EPSG:4326) coordinates and EOProduct is intended to be transmitted as geojson between applications. Therefore it stores geometries in the before mentioned CRS.
- property __geo_interface__#
Builds a representation of EOProduct as a dictionary to enable its geojson serialization
- as_dict()[source]#
Builds a representation of EOProduct as a dictionary to enable its geojson serialization
- download(progress_callback=None, wait=2, timeout=20, **kwargs)[source]#
Download the EO product using the provided download plugin and the authenticator if necessary.
The actual download of the product occurs only at the first call of this method. A side effect of this method is that it changes the
location
attribute of an EOProduct, from its remote address to the local address.- Parameters
progress_callback (
ProgressCallback
or None) – (optional) A method or a callable object which takes a current size and a maximum size as inputs and handle progress bar creation and update to give the user a feedback on the download progresswait (int) – (optional) If download fails, wait time in minutes between two download tries
timeout (int) – (optional) If download fails, maximum time in minutes before stop retrying to download
kwargs (Union[str, bool, dict]) – outputs_prefix (str), extract (bool), delete_archive (bool) and dl_url_params (dict) can be provided as additional kwargs and will override any other values defined in a configuration file or with environment variables.
- Returns
The absolute path to the downloaded product on the local filesystem
- Return type
- Raises
- Raises
- classmethod from_geojson(feature)[source]#
Builds an
EOProduct
object from its representation as geojson
- get_quicklook(filename=None, base_dir=None, progress_callback=None)[source]#
Download the quicklook image of a given EOProduct from its provider if it exists.
- Parameters
filename (str) – (optional) The name to give to the downloaded quicklook. If not given, it defaults to the product’s ID (without file extension).
base_dir (str) – (optional) The absolute path of the directory where to store the quicklooks in the filesystem. If not given, it defaults to the quicklooks directory under this EO product downloader’s
outputs_prefix
config param (e.g. ‘/tmp/quicklooks/’)progress_callback (
ProgressCallback
or None) – (optional) A method or a callable object which takes a current size and a maximum size as inputs and handle progress bar creation and update to give the user a feedback on the download progress
- Returns
The absolute path of the downloaded quicklook
- Return type