sentinelhub.api.base_request

Implementation of base Sentinel Hub interfaces

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

Bases: DataRequest

A base class for Sentinel Hub interfaces

Parameters:
  • download_client_class (Callable) – A class implementing a download client

  • data_folder (str | None) – location of the directory where the fetched data will be saved.

  • config (SHConfig | None) – A custom instance of config class to override parameters from the saved configuration.

payload: dict[str, Any] = {}
abstract property mime_type: MimeType

The mime type of the request.

create_request()[source]

Prepares a download request

Return type:

None

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 | 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 (Tuple[None | str | date, None | str | date] | None) – 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 | None) – Maximum accepted cloud coverage of an image. Float between 0.0 and 1.0. Default is 1.0.

  • mosaicking_order (MosaickingOrder | None) – Mosaicking order, which has to be either ‘mostRecent’, ‘leastRecent’ or ‘leastCC’.

  • upsampling (ResamplingType | None) – A type of upsampling to apply on data

  • downsampling (ResamplingType | None) – A type of downsampling to apply on data

  • other_args (dict[str, Any] | None) – Additional dictionary of arguments. If provided, the resulting dictionary will get updated by it.

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 (BBox | None) – Bounding box describing the area of interest.

  • geometry (Geometry | None) – Geometry describing the area of interest.

  • other_args (dict[str, Any] | None) – Additional dictionary of arguments. If provided, the resulting dictionary will get updated by it.

Return type:

dict[str, Any]

class sentinelhub.api.base_request.InputDataDict(input_data_dict, *, service_url=None)[source]

Bases: dict

An input data dictionary which also holds additional attributes

Parameters:
  • input_data_dict (dict[str, Any]) – A normal dictionary with input parameters

  • service_url (str | None) – A service URL defined by a data collection