sentinelhub_catalog

A client interface for Sentinel Hub Catalog API

class sentinelhub.sentinelhub_catalog.SentinelHubCatalog(config=None, base_url=None)[source]

Bases: sentinelhub.sh_utils.SentinelHubService

The main class for interacting with Sentinel Hub Catalog API

For more details about certain endpoints and parameters check Catalog API documentation.

Parameters:
  • config (SHConfig or None) – A configuration object with required parameters sh_client_id, sh_client_secret, and sh_auth_base_url which is used for authentication and sh_base_url which defines the service deployment that will be used.
  • base_url (str or None) – A deprecated parameter. Use config instead.
get_info()[source]

Provides the main information that define Sentinel Hub Catalog API

Catalog API reference

Returns:A service payload with information
Return type:dict
get_conformance()[source]

Get information about specifications that this API conforms to

Catalog API reference

Returns:A service payload with information
Return type:dict
get_collections()[source]

Provides a list of collections that are available to a user

Catalog API reference

Returns:A list of collections with information
Return type:list(dict)
get_collection(collection)[source]

Provides information about given collection

Catalog API reference

Parameters:collection (DataCollection or str) – A data collection object or a collection ID
Returns:Information about a collection
Return type:dict
get_feature(collection, feature_id)[source]

Provides information about a single feature in a collection

Catalog API reference

Parameters:
  • collection (DataCollection or str) – A data collection object or a collection ID
  • feature_id (str) – A feature ID
Returns:

Information about a feature in a collection

Return type:

dict

search(collection, *, time, bbox=None, geometry=None, ids=None, query=None, fields=None, distinct=None, limit=100, **kwargs)[source]

Catalog STAC search

Catalog API reference

Parameters:
  • collection (DataCollection or str) – A data collection object or a collection ID
  • time ((str, str) or (datetime, datetime) or str or datetime) – A time interval or a single time. It can either be a string in form YYYY-MM-DDThh:mm:ss or YYYY-MM-DD or a datetime object
  • bbox (BBox) – A search bounding box, it will always be reprojected to WGS 84 before being sent to the service. Re-projection will be done with BBox.transform_bounds method which can produce a slightly larger bounding box. If that is a problem then transform a BBox object into a Geometry object and search with geometry parameter instead.
  • geometry (Geometry) – A search geometry, it will always reprojected to WGS 84 before being sent to the service. This parameter is defined with parameter intersects at the service.
  • ids (list(str)) – A list of feature ids as defined in service documentation
  • query (dict) – A STAC query described in Catalog API documentation
  • fields (dict) – A dictionary of fields to include or exclude described in Catalog API documentation
  • distinct (str) – A special query attribute described in Catalog API documentation
  • limit (int) – A number of results to return per each request. At the end iterator will always provide all results the difference is only in how many requests it will have to make in the background.
  • kwargs – Any other parameters that will be passed directly to the service
class sentinelhub.sentinelhub_catalog.CatalogSearchIterator(client, url, params=None)[source]

Bases: sentinelhub.sh_utils.FeatureIterator

Searches a catalog with a given query and provides results

Parameters:
  • client (DownloadClient) – An instance of a download client object
  • url (str) – An URL where requests will be made
  • params (dict or None) – Parameters to be sent with each request
get_timestamps()[source]

Provides features timestamps

Returns:A list of sensing times
Return type:list(datetime.datetime)
get_geometries()[source]

Provides features geometries

Returns:A list of geometry objects with CRS
Return type:list(Geometry)
get_ids()[source]

Provides features IDs

Returns:A list of IDs
Return type:list(str)