sentinelhub_base_api

Implementation of Sentinel Hub Process API interface

class sentinelhub.sentinelhub_base_api.SentinelHubBaseApiRequest(download_client_class, *, data_folder=None, config=None)[source]

Bases: sentinelhub.data_request.DataRequest

A base class for Sentinel Hub interfaces

Parameters:
  • download_client_class (type) – A class implementing a download client
  • data_folder (str) – location of the directory where the fetched data will be saved.
  • config (SHConfig or None) – A custom instance of config class to override parameters from the saved configuration.
create_request()[source]

Prepares a download request

static input_data(data_collection, *, identifier=None, time_interval=None, maxcc=None, mosaicking_order=None, upsampling=None, downsampling=None, other_args=None)[source]

Generate the input data part of the request body

Parameters:
  • data_collection (DataCollection) – One of supported Process API data collections.
  • identifier (str or None) – A collection identifier that can be referred to in the evalscript. Parameter is referenced as “id” in service documentation. To learn more check data fusion documentation.
  • time_interval ((str, str) or (datetime, datetime)) – A time interval with start and end date of the form YYYY-MM-DDThh:mm:ss or YYYY-MM-DD or a datetime object
  • maxcc (float or None) – Maximum accepted cloud coverage of an image. Float between 0.0 and 1.0. Default is 1.0.
  • mosaicking_order (str or None) – Mosaicking order, which has to be either ‘mostRecent’, ‘leastRecent’ or ‘leastCC’.
  • upsampling (str) – A type of upsampling to apply on data
  • downsampling (str) – A type of downsampling to apply on data
  • other_args – Additional dictionary of arguments. If provided, the resulting dictionary will get updated by it.
  • other_args – dict
Returns:

A dictionary-like object that also contains additional attributes

Return type:

InputDataDict

static bounds(bbox=None, geometry=None, other_args=None)[source]

Generate a bound part of the API request

Parameters:
  • bbox (sentinelhub.BBox) – Bounding box describing the area of interest.
  • geometry (sentinelhub.Geometry) – Geometry describing the area of interest.
  • other_args – Additional dictionary of arguments. If provided, the resulting dictionary will get updated by it.
  • other_args – dict
class sentinelhub.sentinelhub_base_api.InputDataDict(input_data_dict, *, service_url=None)[source]

Bases: dict

An input data dictionary which also holds additional attributes

Parameters:
  • input_data_dict (dict) – A normal dictionary with input parameters
  • service_url (str) – A service URL defined by a data collection