sentinelhub.api.catalog
A client interface for Sentinel Hub Catalog API.
- class sentinelhub.api.catalog.SentinelHubCatalog(config=None)[source]
Bases:
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 (Optional[SHConfig]) – 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.
- get_feature(collection, feature_id)[source]
Provides information about a single feature in a collection
- Parameters
collection (DataCollection) – A data collection object or a collection ID
feature_id (str) – A feature ID
- Returns
Information about a feature in a collection
- Return type
- search(collection, *, time=None, bbox=None, geometry=None, ids=None, filter=None, filter_lang='cql2-text', filter_crs=None, fields=None, distinct=None, limit=100, **kwargs)[source]
Catalog STAC search
- Parameters
collection (Union[DataCollection, str]) – A data collection object or a collection ID
time (Union[None, str, date, Tuple[Union[None, str, date], Union[None, str, date]]]) – 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 (Optional[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 (Optional[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 (Optional[List[str]]) – A list of feature ids as defined in service documentation
filter (Union[None, str, Dict[str, Any]]) – A STAC filter in CQL2, described in Catalog API documentation
filter_lang (Literal['cql2-text', 'cql2-json']) – How to parse CQL2 of the filter input, described in Catalog API documentation
filter_crs (Optional[str]) – The CRS used by spatial literals in the ‘filter’ value, provided in URI form. Example input is “http://www.opengis.net/def/crs/OGC/1.3/CRS84”
fields (Optional[Dict[str, Any]]) – A dictionary of fields to include or exclude described in Catalog API documentation
distinct (Optional[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) – Any other parameters that will be passed directly to the service
- Return type
- class sentinelhub.api.catalog.CatalogSearchIterator(*args, **kwargs)[source]
Bases:
FeatureIterator
[Dict
[str
,Any
]]Searches a catalog with a given query and provides results
- Parameters
client – An instance of a download client object
url – A URL where requests will be made
params – Parameters to be sent with each request