sentinelhub_byoc

Module implementing an interface with Sentinel Hub Bring your own COG service

class sentinelhub.sentinelhub_byoc.ByocCollectionAdditionalData(other_data: Optional[CatchAllVar], bands: Optional[dict] = None, max_meters_per_pixel: Optional[float] = None, max_meters_per_pixel_override: Optional[float] = None)[source]

Bases: object

Dataclass to hold BYOC collection additional data

class sentinelhub.sentinelhub_byoc.ByocCollection(name: str, s3_bucket: str, other_data: Optional[CatchAllVar], collection_id: Optional[str] = None, user_id: Optional[str] = None, created: Optional[datetime.datetime] = None, no_data: Union[int, float, None] = None)[source]

Bases: sentinelhub.sh_utils.BaseCollection

Dataclass to hold BYOC collection data

to_data_collection()

Returns a DataCollection enum for this collection

class sentinelhub.sentinelhub_byoc.ByocTile(path: str, other_data: Optional[CatchAllVar], status: Optional[str] = None, tile_id: Optional[str] = None, tile_geometry: Optional[sentinelhub.geometry.Geometry] = None, cover_geometry: Optional[sentinelhub.geometry.Geometry] = None, created: Optional[datetime.datetime] = None, sensing_time: Optional[datetime.datetime] = None, additional_data: Optional[dict] = None)[source]

Bases: object

Dataclass to hold BYOC tile data

class sentinelhub.sentinelhub_byoc.SentinelHubBYOC(config=None, base_url=None)[source]

Bases: sentinelhub.sh_utils.SentinelHubService

An interface class for Sentinel Hub Bring your own COG (BYOC) API

For more info check BYOC API reference.

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.
iter_collections(search=None, **kwargs)[source]

Retrieve collections

BYOC API reference

Parameters:
  • search – A search query
  • kwargs – Any other request parameters
Returns:

iterator over collections

get_collection(collection)[source]

Get collection by its id

BYOC API reference

Parameters:collection – a ByocCollection, dict or collection id string
Returns:dictionary of the collection
Return type:dict
create_collection(collection)[source]

Create a new collection

BYOC API reference

Parameters:collection – ByocCollection object or a dictionary
Returns:dictionary of the created collection
Return type:dict
update_collection(collection)[source]

Update an existing collection

BYOC API reference

Parameters:collection – ByocCollection object or a dictionary
delete_collection(collection)[source]

Delete existing collection by its id

BYOC API reference

Parameters:collection – a ByocCollection, dict or collection id string
copy_tiles(from_collection, to_collection)[source]

Copy tiles from one collection to another

BYOC API reference

Parameters:
  • from_collection – a ByocCollection, dict or collection id string
  • to_collection – a ByocCollection, dict or collection id string
iter_tiles(collection, sort=None, path=None, **kwargs)[source]

Iterator over collection tiles

BYOC API reference

Parameters:
  • collection – a ByocCollection, dict or collection id string
  • sort – Order in which to return tiles
  • path – An exact path where tiles are located
  • kwargs – Any other request parameters
Returns:

iterator

get_tile(collection, tile)[source]

Get a tile of collection

BYOC API reference

Parameters:
  • collection – a ByocCollection, dict or collection id string
  • tile – a ByocTile, dict or tile id string
Returns:

dictionary of the tile

Return type:

dict

create_tile(collection, tile)[source]

Create tile within collection

BYOC API reference

Parameters:
  • collection – a ByocCollection, dict or collection id string
  • tile – a ByocTile or dict
Returns:

dictionary of the tile

Return type:

dict

update_tile(collection, tile)[source]

Update a tile within collection

BYOC API reference

Parameters:
  • collection – a ByocCollection, dict or collection id string
  • tile – a ByocTile or dict
delete_tile(collection, tile)[source]

Delete a tile from collection

BYOC API reference

Parameters:
  • collection – a ByocCollection, dict or collection id string
  • tile – a ByocTile, dict or tile id string