sentinelhub.api.statistical

Implementation of Sentinel Hub Statistical API interface.

class sentinelhub.api.statistical.SentinelHubStatistical(aggregation, input_data, bbox=None, geometry=None, calculations=None, **kwargs)[source]

Bases: SentinelHubBaseApiRequest

Sentinel Hub Statistical API interface

For more information check Statistical API documentation.

For details of certain parameters check the Statistical API reference.

Parameters
  • aggregation (Dict[str, Any]) – Aggregation part of the payload, which can be generated with aggregation method

  • input_data (List[Union[Dict[str, Any], InputDataDict]]) – A list of input dictionary objects as described in the API reference. It can be generated with input_data method

  • bbox (Optional[BBox]) – A bounding box of the request

  • geometry (Optional[Geometry]) – A geometry of the request

  • calculations (Optional[Dict[str, Any]]) – Calculations part of the payload.

  • data_folder – Location of the directory where the downloaded data could be saved.

  • config – A custom instance of config class to override parameters from the saved configuration.

  • kwargs (Any) –

property mime_type: MimeType

The mime type of the request.

static body(request_bounds, request_data, aggregation, calculations, other_args=None)[source]

Generate the Process API request body

Parameters
  • request_bounds (Dict[str, Any]) – A dictionary as generated by bounds helper method.

  • request_data (List[Dict[str, Any]]) – A list of dictionaries as generated by input_data helper method.

  • aggregation (Dict[str, Any]) – A dictionary as generated by aggregation helper method.

  • calculations (Optional[Dict[str, Any]]) – A dictionary defining calculations part of the payload

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

Returns

Request payload dictionary

Return type

Dict[str, Any]

static aggregation(evalscript, time_interval, aggregation_interval, size=None, resolution=None, other_args=None)[source]

Generate the aggregation part of the Statistical API request body

Parameters
  • evalscript (str) – An evalscript.

  • time_interval (Tuple[Union[None, str, date], Union[None, str, date]]) – An interval with start and end date of the form YYYY-MM-DDThh:mm:ss or YYYY-MM-DD or a datetime object

  • aggregation_interval (str) – How data from given time interval is aggregated together

  • size (Optional[Tuple[int, int]]) – A width and height of an image from which data will be aggregated

  • resolution (Optional[Tuple[float, float]]) – A resolution in x and y dimensions of an image from which data will be aggregated. Resolution has to be defined in the same units as request bbox or geometry

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

Returns

Aggregation payload dictionary

Return type

Dict[str, Any]

download_list: List[DownloadRequest]
folder_list: List[str]