Metadata-Version: 2.4
Name: pydggsapi
Version: 0.3.0
Summary: A python FastAPI OGC DGGS API implementation
License-Expression: Apache-2.0
License-File: LICENSE
Author: Wai Tik Chan
Author-email: wai.tik.chan@ut.ee
Maintainer: Wai Tik Chan
Maintainer-email: wai.tik.chan@ut.ee
Requires-Python: >=3.12,<3.14
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: clickhouse-cityhash (>=1.0.2.5,<2.0.0.0)
Requires-Dist: clickhouse-driver[lz4,zstd] (>=0.2.6,<0.3.0)
Requires-Dist: dggal (>=0.0.5,<0.0.6)
Requires-Dist: dggrid4py (>=0.5.3,<0.6.0)
Requires-Dist: duckdb (>=1.3.2,<2.0.0)
Requires-Dist: fastapi (>=0.123.3)
Requires-Dist: gcsfs (>=2025.10.0,<2026.0.0)
Requires-Dist: gunicorn (>=23.0.0,<24.0.0)
Requires-Dist: h3 (>=4.2.0,<5.0.0)
Requires-Dist: mapbox-vector-tile (>=2.0.1,<3.0.0)
Requires-Dist: morecantile (>=5.0.0,<6.0.0)
Requires-Dist: nest-asyncio (>=1.6.0,<2.0.0)
Requires-Dist: ordered-set (>=4.1.0,<5.0.0)
Requires-Dist: py-ubjson (>=0.16.1,<0.17.0)
Requires-Dist: pygeofilter (>=0.3.1,<0.4.0)
Requires-Dist: pyproj (>=3.6.1,<4.0.0)
Requires-Dist: pytest-env (>=1.6.0,<2.0.0)
Requires-Dist: python-dotenv (>=1.0.0,<2.0.0)
Requires-Dist: scipy (>=1.15.0,<2.0.0)
Requires-Dist: shapely (>=2.0.2,<3.0.0)
Requires-Dist: tinydb (>=4.8.2,<5.0.0)
Requires-Dist: uvicorn (>=0.23.2,<0.24.0)
Requires-Dist: xarray-sql (>=0.1.1,<0.2.0)
Requires-Dist: xarray[io] (>=2025.3.1,<2026.0.0)
Requires-Dist: zarr (>=3.2.1,<4.0.0)
Description-Content-Type: text/markdown

# pydggsapi

![Version](https://img.shields.io/badge/version-0.3.0-blue)

A python FastAPI OGC DGGS API implementation

https://pydggsapi.readthedocs.io/en/latest/



## OGC API - Discrete Global Grid Systems

https://ogcapi.ogc.org/dggs/

OGC API - DGGS specifies an API for accessing data organised according to a Discrete Global Grid Reference System (DGGRS). A DGGRS is a spatial reference system combining a discrete global grid hierarchy (DGGH, a hierarchical tessellation of zones to partition) with a zone indexing reference system (ZIRS) to address the globe. Aditionally, to enable DGGS-optimized data encodings, a DGGRS defines a deterministic for sub-zones whose geometry is at least partially contained within a parent zone of a lower refinement level. A Discrete Global Grid System (DGGS) is an integrated system implementing one or more DGGRS together with functionality for quantization, zonal query, and interoperability. DGGS are characterized by the properties of the zone structure of their DGGHs, geo-encoding, quantization strategy and associated mathematical functions.

![](bids25_fig1.png)

## Setup
Please refer to the [Quick Setup](https://pydggsapi.readthedocs.io/en/latest/introduction.html#quick-setup) section from the documentation for details.

## Configration and implementation details

Please refer to the [Configuration](https://pydggsapi.readthedocs.io/en/latest/tinydb_configuration/index.html) section from the documentation for details.

## Example notebook
Please refer to the [Example](https://pydggsapi.readthedocs.io/en/latest/example_notebook/pydggsapi_demo_notebook.html#) section from the documentation for demonstration.

## Conformance Classes

The API implemented the dggrs-core, zone-query and zone data retrieval, conformal class. The following list shows the conformance classes supported by the API. Users can also refer to the [example notebook](https://pydggsapi.readthedocs.io/en/latest/example_notebook/Endpoints_Examples.html) from the pydggsapi documentation for examples of the query endpoints.

| Conformance Class| Supported by the API|
| ---------------- | ------------------- |
| **Core**         |                     |
| http://www.opengis.net/spec/ogcapi-common-1/1.0/conf/core | ✅ |
| **OGC API integration**|               |
| https://www.opengis.net/spec/ogcapi-dggs-1/1.0/conf/root-dggs | ✅ |
| https://www.opengis.net/spec/ogcapi-dggs-1/1.0/conf/collection-dggs | ✅ |
| https://www.opengis.net/spec/ogcapi-dggs-1/1.0/conf/operation-ids | ❌ |
| **For Data Retrieval**|                |
| https://www.opengis.net/spec/ogcapi-dggs-1/1.0/conf/data-retrieval | ✅ |
| https://www.opengis.net/spec/ogcapi-dggs-1/1.0/conf/data-subsetting | partially: `datetime`, `properties` and `exclude-properties`|
| https://www.opengis.net/spec/ogcapi-dggs-1/1.0/conf/data-custom-depths | ✅ |
| https://www.opengis.net/spec/ogcapi-dggs-1/1.0/conf/data-cql2-filter | ✅ |
| **For Zone Queries**|                  | 
| https://www.opengis.net/spec/ogcapi-dggs-1/1.0/conf/zone-query | ✅ , query parameter `subset` and `subset-crs` is not supported yet|
| https://www.opengis.net/spec/ogcapi-dggs-1/1.0/conf/zone-query-cql2-filter | ✅ |
| **Zone Data Encodings**|               |
| https://www.opengis.net/spec/ogcapi-dggs-1/1.0/conf/data-json | ✅ |
| https://www.opengis.net/spec/ogcapi-dggs-1/1.0/conf/data-ubjson | ✅ | 
| https://www.opengis.net/spec/ogcapi-dggs-1/1.0/conf/data-dggs-jsonfg | ✅ |
| https://www.opengis.net/spec/ogcapi-dggs-1/1.0/conf/data-dggs-ubjsonfg | ✅ |
| https://www.opengis.net/spec/ogcapi-dggs-1/1.0/conf/data-geojson | ✅ |
| https://www.opengis.net/spec/ogcapi-dggs-1/1.0/conf/data-geotiff | ❌ |
| https://www.opengis.net/spec/ogcapi-dggs-1/1.0/conf/data-netcdf | ❌ |
| https://www.opengis.net/spec/ogcapi-dggs-1/1.0/conf/data-coveragejson | ❌ |
| https://www.opengis.net/spec/ogcapi-dggs-1/1.0/conf/data-zarr | ✅ |
| https://www.opengis.net/spec/ogcapi-dggs-1/1.0/conf/data-jpegxl | ❌ |
| https://www.opengis.net/spec/ogcapi-dggs-1/1.0/conf/data-png | ❌ |
| **Zone List Encodings**|                |
| https://www.opengis.net/spec/ogcapi-dggs-1/1.0/conf/zone-html | ❌ |
| https://www.opengis.net/spec/ogcapi-dggs-1/1.0/conf/zone-uint64 | ❌ | 
| https://www.opengis.net/spec/ogcapi-dggs-1/1.0/conf/zone-geojson | ✅ |
| https://www.opengis.net/spec/ogcapi-dggs-1/1.0/conf/zone-geotiff | ❌ |



## Acknowledgments

This software is being developed by the [Landscape Geoinformatics Lab](https://landscape-geoinformatics.ut.ee/expertise/dggs/) of the University of Tartu, Estonia.

This work was funded by the Estonian Research Agency (grant number PRG1764, PSG841), Estonian Ministry of Education and Research (Centre of Excellence for Sustainable Land Use (TK232)), and by the European Union (ERC, [WaterSmartLand](https://water-smart-land.eu/), 101125476 and Interreg-BSR, [HyTruck](https://interreg-baltic.eu/project/hytruck/), #C031).

