geodesic.boson.dataset.Dataset.from_image_tiles#
- static Dataset.from_image_tiles(name, url, layer=None, max_zoom=23, credential=None, middleware={}, cache={}, tile_options={}, domain='*', category='*', type='*', **kwargs)[source]#
Creates a new Dataset from a WMTS server, ArcGIS Map Service Tiles, XYZ, or TMS service.
Provides access to the pixel data from an image tile service. Currently we support three types of services: WMTS, ArcGIS MapServices, and XYZ/TMS. If a WMTS service is provided, the layer must also be provided. Note that while tile services visually appear like “data”, they are typically pre-rendered, meaning RGBa values that visually represent data. They are well suited for visualizing data, but not for analysis except for things like computer vision, object detection or other things that can work with visible bands on MSI imagery. Some services may provide analysis ready data via tile services due to ease of caching the data, but this is not typical. This provider is also useful when a WMTS service uses a non-standard tile matrix set, as it Boson can reproject the tiles to the standard WebMercator tile matrix set for consumption in the vast majority of GIS/mapping software.
See examples below for more detail.
- Parameters:
name (str) – name of the Dataset to create
url (str) – the url to the tile service
layer (str | None) – the name of the layer to use if a WMTS service is provided
max_zoom (int) – the maximum zoom level to request tiles. Defaults to 23. This controls the maximum native resolution of the source tiles.
credential (str | None) – the name or uid of a credential to access the service
middleware (MiddlewareConfig | list) – configure any boson middleware to be applied to the new dataset.
cache (CacheConfig) – configure caching for this dataset
tile_options (TileOptions) – configure tile options for this dataset
domain (str) – domain of the resulting
Objectcategory (str) – category of the resulting
Objecttype (str) – the type of the resulting
Object**kwargs – additional properties to set on the new
Dataset
- Returns:
a new Dataset.
- Return type:
Examples
>>> ds = Dataset.from_image_tiles( ... name="my-dataset", ... url="https://my-tile-service.com/{z}/{y}/{x}", ...) >>> ds.stage() >>> # Staging is optional, but is a useful tool for validating configuration >>> ds.save()
>>> ds = Dataset.from_image_tiles( ... name="hurricane-helene", ... url="https://my-arcgis-service.com/arcgis/rest/services/MyService/MapServer/WMTS", ... layer="20240927a-rgb", ... credential="my-creds" ...) >>> ds.stage() >>> # Staging is optional, but is a useful tool for validating configuration >>> ds.save()
>>> ds = Dataset.from_image_tiles( ... name="hurricane-helene", ... url="https://storms.ngs.noaa.gov/storms/helene/services/WMTSCapabilities.xml", ... layer="20240927a-rgb", ... credential="my-creds" ... ) >>> ds.stage() >>> # Staging is optional, but is a useful tool for validating configuration >>> ds.save()
>>> ds = Dataset.from_image_tiles( ... name="my-dataset", ... url="https://my-arcgis-service.com/arcgis/rest/services/MyService/MapServer", ... credential="my-creds" ...) >>> ds.stage() >>> # Staging is optional, but is a useful tool for validating configuration >>> ds.save()