sentinelhub.api.opensearch

Module for communication with Sentinel Hub Opensearch service.

For more search parameters check service description.

exception sentinelhub.api.opensearch.TileMissingException[source]

Bases: Exception

This exception is raised when requested tile is missing at Sentinel Hub Opensearch service

sentinelhub.api.opensearch.get_tile_info_id(tile_id)[source]

Get basic information about image tile

Parameters

tile_id (str) – original tile identification string provided by ESA (e.g. ‘S2A_OPER_MSI_L1C_TL_SGS__20160109T230542_A002870_T10UEV_N02.01’)

Returns

dictionary with info provided by Opensearch REST service

Raises

TileMissingException if no tile with tile ID tile_id exists

Return type

Dict[str, Any]

sentinelhub.api.opensearch.get_tile_info(tile, time, aws_index=None, all_tiles=False)[source]

Get basic information about image tile

Parameters
  • tile (str) – tile name (e.g. 'T10UEV')

  • time (Union[None, str, date, Tuple[Union[None, str, date], Union[None, str, date]]]) – A single date or a time interval

  • aws_index (Optional[int]) – index of tile on AWS

  • all_tiles (bool) – If True it will return list of all tiles otherwise only the first one

Returns

dictionary (or list of dictionaries) with info provided by Opensearch REST service

Return type

Union[Dict[str, Any], List[Dict[str, Any]]]

sentinelhub.api.opensearch.get_area_info(bbox, date_interval, maxcc=None)[source]

Get information about all images from specified area and time range

Parameters
  • bbox (BBox) – bounding box of requested area

  • date_interval (Tuple[Union[None, str, date], Union[None, str, date]]) – a pair of time strings in ISO8601 format

  • maxcc (Optional[float]) – filter images by maximum percentage of cloud coverage

Returns

iterator of dictionaries containing info provided by Opensearch REST service

Return type

List[Dict[str, Any]]

sentinelhub.api.opensearch.get_area_dates(bbox, date_interval, maxcc=None)[source]

Get list of times of existing images from specified area and time range

Parameters
  • bbox (BBox) – bounding box of requested area

  • date_interval (Tuple[Union[None, str, date], Union[None, str, date]]) – a pair of time strings in ISO8601 format

  • maxcc (Optional[int]) – filter images by maximum percentage of cloud coverage

Returns

list of time strings in ISO8601 format

Return type

List[date]

sentinelhub.api.opensearch.reduce_by_maxcc(result_list, maxcc)[source]

Filter list image tiles by maximum cloud coverage

Parameters
  • result_list (Iterable[Dict[str, Any]]) – list of dictionaries containing info provided by Opensearch REST service

  • maxcc (float) – filter images by maximum percentage of cloud coverage

Returns

list of dictionaries containing info provided by Opensearch REST service

Return type

List[Dict[str, Any]]

sentinelhub.api.opensearch.search_iter(tile_id=None, bbox=None, start_date=None, end_date=None, absolute_orbit=None, config=None)[source]

A generator function that implements OpenSearch search queries and returns results

All parameters for search are optional.

Parameters
  • tile_id (Optional[str]) – original tile identification string provided by ESA (e.g. ‘S2A_OPER_MSI_L1C_TL_SGS__20160109T230542_A002870_T10UEV_N02.01’)

  • bbox (Optional[BBox]) – bounding box of requested area

  • start_date (Union[None, str, date]) – beginning of time range

  • end_date (Union[None, str, date]) – end of time range

  • absolute_orbit (Optional[int]) – An absolute orbit number of Sentinel-2 L1C products as defined by ESA

  • config (Optional[SHConfig]) – A custom instance of config class to override parameters from the saved configuration.

Returns

An iterator returning dictionaries with info provided by Sentinel Hub OpenSearch REST service

Return type

Iterator[Dict[str, Any]]