sentinelhub.api.byoc
Module implementing an interface with Sentinel Hub Bring Your Own COG API.
- class sentinelhub.api.byoc.ByocCollectionBand(source=None, band_index=None, bit_depth=8, sample_format='UINT', no_data=None, other_data=<factory>)[source]
Bases:
object
Dataclass to hold BYOC collection band specification
- Parameters:
- dataclass_json_config = {'letter_case': <function camelcase>, 'undefined': Undefined.INCLUDE}
- classmethod from_dict(kvs, *, infer_missing=False)
- 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_json(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, indent=None, separators=None, default=None, sort_keys=False, **kw)
- class sentinelhub.api.byoc.ByocCollectionAdditionalData(bands=None, max_meters_per_pixel=None, max_meters_per_pixel_override=None, other_data=<factory>)[source]
Bases:
object
Dataclass to hold BYOC collection additional data
- Parameters:
bands (Dict[str, ByocCollectionBand] | None) –
max_meters_per_pixel (float | None) –
max_meters_per_pixel_override (float | None) –
other_data (CatchAllVar | None) –
- bands: Dict[str, ByocCollectionBand] | None = None
- dataclass_json_config = {'letter_case': <function camelcase>, 'undefined': Undefined.INCLUDE}
- classmethod from_dict(kvs, *, infer_missing=False)
- 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_json(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, indent=None, separators=None, default=None, sort_keys=False, **kw)
- class sentinelhub.api.byoc.ByocCollection(name, s3_bucket, additional_data=None, collection_id=None, user_id=None, created=None, no_data=None, other_data=<factory>)[source]
Bases:
BaseCollection
Dataclass to hold BYOC collection data
- Parameters:
- additional_data: ByocCollectionAdditionalData | None = None
- dataclass_json_config = {'letter_case': <function camelcase>, 'undefined': Undefined.INCLUDE}
- classmethod from_dict(kvs, *, infer_missing=False)
- 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_json(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, indent=None, separators=None, default=None, sort_keys=False, **kw)
- class sentinelhub.api.byoc.ByocTile(path, status=None, tile_id=None, tile_geometry=None, cover_geometry=None, created=None, sensing_time=None, additional_data=None, other_data=<factory>)[source]
Bases:
object
Dataclass to hold BYOC tile data
- Parameters:
- dataclass_json_config = {'letter_case': <function camelcase>, 'undefined': Undefined.INCLUDE}
- classmethod from_dict(kvs, *, infer_missing=False)
- 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_json(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, indent=None, separators=None, default=None, sort_keys=False, **kw)
- class sentinelhub.api.byoc.SentinelHubBYOC(config=None)[source]
Bases:
SentinelHubService
An interface class for Sentinel Hub Bring your own COG (BYOC) API
For more info check BYOC API reference.
- Parameters:
config (SHConfig | 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.
- iter_collections(search=None, **kwargs)[source]
Retrieve collections
- Parameters:
- Returns:
iterator over collections
- Return type:
- get_collection(collection)[source]
Get collection by its id
- Parameters:
collection (ByocCollection | DataCollection | dict | str) – a ByocCollection, dict or collection id string
- Returns:
dictionary of the collection
- Return type:
- create_collection(collection)[source]
Create a new collection
- Parameters:
collection (ByocCollection | DataCollection | dict | str) – ByocCollection object or a dictionary
- Returns:
dictionary of the created collection
- Return type:
- copy_tiles(from_collection, to_collection)[source]
Copy tiles from one collection to another
- Parameters:
from_collection (ByocCollection | DataCollection | dict | str) – a ByocCollection, dict or collection id string
to_collection (ByocCollection | DataCollection | dict | str) – a ByocCollection, dict or collection id string
- Return type:
- iter_tiles(collection, sort=None, path=None, **kwargs)[source]
Iterator over collection tiles
- Parameters:
collection (ByocCollection | DataCollection | dict | str) – a ByocCollection, dict or collection id string
sort (str | None) – Order in which to return tiles
path (str | None) – An exact path where tiles are located
kwargs (Any) – Any other request parameters
- Returns:
An iterator over payloads of tiles from the collection
- Return type:
- get_tile(collection, tile)[source]
Get a tile of collection
- Parameters:
collection (ByocCollection | DataCollection | dict | str) – a ByocCollection, dict or collection id string
tile (ByocTile | dict | str) – a ByocTile, dict or tile id string
- Returns:
dictionary of the tile
- Return type:
- create_tile(collection, tile)[source]
Create tile within collection
- Parameters:
collection (ByocCollection | DataCollection | dict | str) – a ByocCollection, dict or collection id string
- Returns:
dictionary of the tile
- Return type: