satorbis_kit.visualization.config module

Configuration classes for STAC visualization.

class satorbis_kit.visualization.config.TiTilerConfig(endpoint: str = 'https://dev.rs.satsure.co/titiler', api_key: str | None = None, timeout: int = 30, tile_matrix_set: str = 'WebMercatorQuad')[source]

Bases: object

Configuration for TiTiler-pgSTAC endpoint.

endpoint

Base URL of the TiTiler-pgSTAC server (e.g., ‘https://dev.rs.satsure.co/titiler’)

Type:

str

api_key

Optional API key for authentication

Type:

str | None

timeout

Request timeout in seconds

Type:

int

tile_matrix_set

Tile matrix set (default: WebMercatorQuad)

Type:

str

Example

>>> config = TiTilerConfig(
...     endpoint='https://dev.rs.satsure.co/titiler',
...     api_key='your-api-key'
... )
api_key: str | None = None
endpoint: str = 'https://dev.rs.satsure.co/titiler'
get_headers() Dict[str, str][source]

Get headers for API requests.

get_tile_url(collection: str, item_id: str) str[source]

Get the tile URL for a STAC item.

Returns URL pattern: /collections/{collection}/items/{item_id}/tiles/WebMercatorQuad/{z}/{x}/{y}

Parameters:
  • collection – STAC collection ID

  • item_id – STAC item ID

Returns:

Tile URL template

tile_matrix_set: str = 'WebMercatorQuad'
timeout: int = 30
class satorbis_kit.visualization.config.VisualizationConfig(titiler: TiTilerConfig = <factory>, stac_api_url: str | None = None, default_center: List[float] = <factory>, default_zoom: int = 4, basemap: str = 'OpenStreetMap', show_bounds: bool = False, show_metadata: bool = True, opacity: float = 0.8)[source]

Bases: object

Configuration for STAC visualization.

titiler

TiTiler-pgSTAC server configuration

Type:

satorbis_kit.visualization.config.TiTilerConfig

stac_api_url

STAC API base URL

Type:

str | None

default_center

Default map center [lat, lon]

Type:

List[float]

default_zoom

Default map zoom level

Type:

int

basemap

Default basemap

Type:

str

show_bounds

Show item bounds on map

Type:

bool

show_metadata

Show metadata popups

Type:

bool

opacity

Default layer opacity (0-1)

Type:

float

Example

>>> config = VisualizationConfig(
...     titiler=TiTilerConfig(endpoint='https://dev.rs.satsure.co/titiler'),
...     stac_api_url='http://localhost:8080',
...     default_zoom=10
... )
PRESETS = {'false_color': {'assets': 'nir,red,green', 'color_formula': 'Gamma RGB 2.5', 'rescale': '0,3000'}, 'ndvi': {'assets': 'nir,red', 'colormap_name': 'rdylgn', 'expression': '(nir-red)/(nir+red)', 'rescale': '-1,1'}, 'ndwi': {'assets': 'green,nir', 'colormap_name': 'blues', 'expression': '(green-nir)/(green+nir)', 'rescale': '-1,1'}, 'rgb': {'assets': 'red,green,blue', 'color_formula': 'Gamma RGB 3.5 Saturation 1.7 Sigmoidal RGB 15 0.35', 'rescale': '0,3000'}}
basemap: str = 'OpenStreetMap'
default_center: List[float]
default_zoom: int = 4
get_preset(name: str) Dict[str, str][source]

Get a visualization preset by name.

Parameters:

name – Preset name (‘rgb’, ‘ndvi’, ‘ndwi’, ‘false_color’)

Returns:

Dictionary of TiTiler parameters

Raises:

KeyError – If preset name doesn’t exist

opacity: float = 0.8
show_bounds: bool = False
show_metadata: bool = True
stac_api_url: str | None = None
titiler: TiTilerConfig