sentinelhub.api.batch.statistical
Module implementing an interface with Sentinel Hub Batch Processing API.
- class sentinelhub.api.batch.statistical.SentinelHubBatchStatistical(config=None)[source]
Bases:
BaseBatchClient
[BatchStatisticalRequest
]An interface class for Sentinel Hub Batch Statistical API
Check Batch Statistical API for more information.
- Parameters:
config – 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.
- s3_specification(access_key, secret_access_key, region=None)
A helper method to build a dictionary used for specifying S3 paths
- Parameters:
url (str) – A URL pointing to an S3 bucket or an object in an S3 bucket.
access_key (str) – AWS access key that allows programmatic access to the S3 bucket specified in the url field.
secret_access_key (str) – AWS secret access key which must correspond to the AWS access key.
region (str | None) – The region where the S3 bucket is located. If omitted, the region of the Sentinel Hub deployment that the request is submitted to is assumed.
- Returns:
A dictionary of S3 specifications used by the Batch Statistical API
- Return type:
- create(*, input_features, input_data, aggregation, calculations, output, **kwargs)[source]
Create a new batch statistical request
Batch Statistical API reference
- Parameters:
input_features (AccessSpecification) –
input_data (Sequence[Dict[str, Any] | InputDataDict]) –
output (AccessSpecification) –
kwargs (Any) –
- Return type:
- create_from_request(statistical_request, input_features, output, **kwargs)[source]
Create a new batch statistical request from an existing statistical request.
- Parameters:
statistical_request (SentinelHubStatistical) – A Sentinel Hub Statistical request.
input_features (AccessSpecification) – A dictionary describing the S3 path and credentials to access the input GeoPackage.
output (AccessSpecification) – A dictionary describing the S3 path and credentials to access the output folder.
kwargs (Any) – Any other arguments to be added to a dictionary of parameters
- Returns:
A Batch Statistical request with the same calculations and aggregations but using geometries specified in the input GeoPackage.
- Return type:
- get_request(batch_request)[source]
Collects information about a single batch request
Batch Statistical API reference
- Returns:
Batch request info
- Parameters:
batch_request (str | dict | BatchStatisticalRequest) –
- Return type:
- class sentinelhub.api.batch.statistical.BatchStatisticalRequest(request_id, completion_percentage, request, status, user_id=None, created=None, cost_pu=None, user_action=None, user_action_updated=None, error=None, other_data=<factory>)[source]
Bases:
BaseBatchRequest
A dataclass object that holds information about a batch statistical request
- Parameters:
request_id (str) –
completion_percentage (float) –
request (dict) –
status (BatchRequestStatus) –
user_id (str | None) –
created (datetime | None) –
cost_pu (float | None) –
user_action (BatchUserAction | None) –
user_action_updated (str | None) –
error (str | None) –
other_data (CatchAllVar | None) –
- status: BatchRequestStatus
- user_action: BatchUserAction | None = None
- dataclass_json_config = {'letter_case': <function camelcase>, 'undefined': Undefined.INCLUDE}
- classmethod from_dict(kvs, *, infer_missing=False)
Transforms itself into a dictionary form.
- classmethod from_json(s, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw)
- classmethod schema(*, infer_missing=False, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)
- to_dict(encode_json=False)
Transforms itself into a dictionary form.
- to_json(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, indent=None, separators=None, default=None, sort_keys=False, **kw)