Skip to main content

Tiles router for xpublish

Project description

xpublish-tiles

Web mapping plugins for Xpublish

Project Overview

This project contains a set of web mapping plugins for Xpublish - a framework for serving xarray datasets via HTTP APIs.

The goal of this project is to transform xarray datasets to raster, vector and other types of tiles, which can then be served via HTTP APIs. To do this, the package implements a set of xpublish plugins:

  • xpublish_tiles.xpublish.tiles.TilesPlugin: An OGC Tiles conformant plugin for serving raster, vector and other types of tiles.
  • xpublish_tiles.xpublish.wms.WMSPlugin: An OGC Web Map Service conformant plugin for serving raster, vector and other types of tiles.

Development

Sync the environment with uv

uv sync

Run the type checker

uv run ty check

Run the tests

uv run pytest tests --where=local

CLI Usage

The package includes a command-line interface for quickly serving datasets with tiles and WMS endpoints:

uv run xpublish-tiles [OPTIONS]

Options

  • --port PORT: Port to serve on (default: 8080)
  • --dataset DATASET: Dataset to serve (default: global)
    • global: Generated global dataset with synthetic data
    • air: Tutorial air temperature dataset
    • For Arraylake datasets: specify the dataset name in {arraylake_org}/{arraylake_dataset} format (requires Arraylake credentials)
  • --branch BRANCH: Branch to use for Arraylake datasets (default: main)
  • --group GROUP: Group to use for Arraylake datasets (default: '')
  • --cache: Enable icechunk cache for Arraylake datasets

[!TIP] You can control if the tile servers data loading is async or not with the XPUBLISH_TILES_ASYNC_LOAD environment variable (1 for async mode, 0 for sync mode, async is enabled by default). You can also control the zarr concurrency with the ZARR_ASYNC__CONCURRENCY environment variable (default: 10).

Examples

# Serve synthetic global dataset on default port 8080
xpublish-tiles

# Serve air temperature tutorial dataset on port 9000
xpublish-tiles --port 9000 --dataset air

# Serve Arraylake dataset with specific branch and group
xpublish-tiles --dataset earthmover-public/aifs-outputs --branch main --group 2025-04-01/12z --cache

Once running, the server provides:

  • Tiles API at http://localhost:8080/tiles/
  • WMS API at http://localhost:8080/wms/
  • Interactive API documentation at http://localhost:8080/docs

An example tile url:

http://localhost:8080/tiles/WebMercatorQuad/4/4/14?variables=2t&style=raster/viridis&colorscalerange=280,300&width=256&height=256&valid_time=2025-04-03T06:00:00

Where 4/4/14 represents the tile coordinates in {z}/{y}/{x}

Integration Examples

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xpublish_tiles-0.1.1.tar.gz (3.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xpublish_tiles-0.1.1-py3-none-any.whl (50.8 kB view details)

Uploaded Python 3

File details

Details for the file xpublish_tiles-0.1.1.tar.gz.

File metadata

  • Download URL: xpublish_tiles-0.1.1.tar.gz
  • Upload date:
  • Size: 3.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for xpublish_tiles-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e424f7dc798c751e45ed04b3c4e322f754c1431f1c15d5ac30facf283d15f49f
MD5 c05003dd3ea9308c0e852111e7f38dbb
BLAKE2b-256 7f2e4650a08bd898807636617610cc19940f76927b1b73cf333af7854f26bde3

See more details on using hashes here.

Provenance

The following attestation bundles were made for xpublish_tiles-0.1.1.tar.gz:

Publisher: publish.yml on earth-mover/xpublish-tiles

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file xpublish_tiles-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: xpublish_tiles-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 50.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for xpublish_tiles-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 97ff21ef0cad053b023922069382ddfa303e8e8e186a3e1814bfbf914db8fb53
MD5 c2b0daa202a49fe309ac12a5d8b2bdd8
BLAKE2b-256 b78b07357de3d08e8f7013251aad79654a7ab3116a09ff5397019ee683deb9e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for xpublish_tiles-0.1.1-py3-none-any.whl:

Publisher: publish.yml on earth-mover/xpublish-tiles

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page