Skip to content

Commit dadcd37

Browse files
committed
Version 0.0.6
- Finalized 7H sub-zone support (for pentagonal ancestral zones) - Improved icosahedral area projections precision - Fixes for using authalic conversion functions from Python bindings - Other fixes and improvements
1 parent cd5abda commit dadcd37

File tree

6 files changed

+59
-39
lines changed

6 files changed

+59
-39
lines changed

.github/workflows/wheels.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
# os: [windows-2019] #latest]
1414
# os: [macos-latest]
1515
# os: [macos-13]
16-
os: [ubuntu-latest, windows-2022, ubuntu-24.04-arm, macos-13, macos-latest]
16+
os: [ubuntu-latest, windows-2022, ubuntu-24.04-arm, macos-15-intel, macos-latest]
1717

1818
steps:
1919
- uses: actions/checkout@v4
@@ -22,7 +22,7 @@ jobs:
2222
if: runner.os == 'macOS'
2323
uses: actions/setup-python@v4
2424
with:
25-
python-version: '3.8'
25+
python-version: '3.11'
2626

2727
# Apply patch only on Windows
2828
- name: Apply header patch on Windows
@@ -31,12 +31,14 @@ jobs:
3131
# Patch MinGW-w64 header files currently causing troubles for eC compiler (C99 .namedmembers assignments in AVX files, and re-defnitions of function type typedef in winbase.h)
3232
#git apply --directory=mingw64 '${{ github.workspace }}\patches\mingw64-gcc-12.2.0-patches.patch'
3333
cd C:\
34-
copy ${{ github.workspace }}\patches\lib\gcc\x86_64-w64-mingw32\12.2.0\include\avx512fp16intrin.h C:\mingw64\lib\gcc\x86_64-w64-mingw32\12.2.0\include\avx512fp16intrin.h
35-
copy ${{ github.workspace }}\patches\lib\gcc\x86_64-w64-mingw32\12.2.0\include\avx512fp16vlintrin.h C:\mingw64\lib\gcc\x86_64-w64-mingw32\12.2.0\include\avx512fp16vlintrin.h
34+
copy ${{ github.workspace }}\patches\lib\gcc\x86_64-w64-mingw32\12.2.0\include\avx512fp16intrin.h C:\mingw64\lib\gcc\x86_64-w64-mingw32\14.2.0\include\avx512fp16intrin.h
35+
copy ${{ github.workspace }}\patches\lib\gcc\x86_64-w64-mingw32\12.2.0\include\avx512fp16vlintrin.h C:\mingw64\lib\gcc\x86_64-w64-mingw32\14.2.0\include\avx512fp16vlintrin.h
3636
copy ${{ github.workspace }}\patches\x86_64-w64-mingw32\include\winbase.h C:\mingw64\x86_64-w64-mingw32\include\winbase.h
3737
3838
# Used to host cibuildwheel
3939
- uses: actions/setup-python@v5
40+
with:
41+
python-version: '3.11'
4042

4143
- name: Initialize submodules
4244
run: git submodule update --init --recursive
@@ -47,11 +49,10 @@ jobs:
4749
- name: Build wheels
4850
run: python3 -m cibuildwheel --output-dir wheelhouse
4951
env:
52+
CIBW_ENABLE: "pypy"
5053
# Windows PyPy 3.8 build is currently failing due to https://github.com/python-cffi/cffi/issues/170
5154
# 32-bit builds on Windows are not supported because the MinGW-w64 does not have multilib enabled
52-
# musllinux builds do not currently work
53-
# There seems to be setuptools-related issues with 3.6 and 3.7 CPython builds
54-
CIBW_SKIP: "cp36-* cp37-* *-win32 pp*-win*"
55+
CIBW_SKIP: "*-win32 pp*-win*"
5556
# This ensures WIN_SHELL_COMMANDS does not get defined on Windows in crossplatform.mk, which breaks deep directory creations
5657
# since commands are executed in a UNIX-like shell expecting 'mkdir -p'
5758
CIBW_ENVIRONMENT: 'MSYSCON=y PIP_FIND_LINKS="https://pypi.org/simple/ecrt https://pypi.org/simple/ecdev"'

MANIFEST.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@ recursive-exclude dggal .git**
99
recursive-exclude dggal *.geojson**
1010
recursive-exclude dggal tutorial/**
1111
recursive-exclude dggal */__pycache__
12-
recursive-exclude dggal bindings/rust/**
13-
recursive-exclude dggal bindings/cpp/**
1412
recursive-exclude dggal bindings/*/*ecrt**
1513
recursive-exclude dggal bindings/py/_pydggal.c
1614
include setup.py
15+
include pyproject.toml
1716
include README.md
1817
include dgg_wrapper.py

README.md

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
https://dggal.org
77

88
DGGAL provides a common interface to perform various operations on Discrete Global Grid Reference Systems (DGGRS), facilitating the implementation of Discrete Global Grid Systems (DGGS),
9-
including implementing Web APIs based on the [OGC API - DGGS Standard](https://docs.ogc.org/DRAFTS/21-038r1.html).
9+
including implementing Web APIs based on the [OGC API - DGGS Standard](https://docs.ogc.org/is/21-038r1/21-038r1.html).
1010

1111
Copyright (c) 2014-2025, Ecere Corporation
1212

@@ -20,59 +20,55 @@ Python packaging: https://github.com/ecere/pydggal
2020

2121
DGGAL is already being integrated in several DGGS-enabled software, notably:
2222

23-
- [Vgrid plugin for QGIS](https://plugins.qgis.org/plugins/vgridtools/) and [Vgrid DGGS](https://vgrid.gishub.vn/notebooks/08_dggal/),
23+
- [Vgrid plugin for QGIS](https://plugins.qgis.org/plugins/vgridtools/), [Vgrid DGGS](https://vgrid.gishub.vn/notebooks/08_dggal/), and [Vgrid plugin for Map Libre](https://github.com/opengeoshub/vgrid-maplibre/),
2424
- FME Community Modules: [DGGS Indexer](https://community.safe.com/fme-hub-alerts-55/dggsindexer-38685), [DGGS Relator](https://community.safe.com/fme-hub-alerts-55/dggsrelator-38765),
2525
[DGGS-JSON Decoder](https://community.safe.com/fme-hub-alerts-55/dggsjsondecoder-387740), and [DGGS-JSON Encoder](https://community.safe.com/fme-hub-alerts-55/dggsjsonencoder-38787),
2626
- [a5geo](https://a5geo.org/) (adapting the DGGAL code for the DSEA / IVEA equal-area projection),
2727
- [pydggsapi](https://github.com/LandscapeGeoinformatics/pydggsapi/tree/dggal),
2828
- [GeoPlegma](https://github.com/GeoPlegma),
29+
- [Geotoolkit](https://github.com/Geomatys/geotoolkit), a testing ground for [Apache SIS](https://sis.apache.org/),
2930
- [Ecere](https://ecere.ca)'s [GNOSIS Software Development Kit](http://gnosis.earth/) and [GNOSIS Map Server](https://maps.gnosis.earth).
3031

3132
## Supported Discrete Global Grid Reference Systems
3233

33-
DGGAL currently supports all nine DGGRSs described in [OGC API - DGGS Annex B](https://docs.ogc.org/DRAFTS/21-038r1.html#annex-dggrs-def), as well as additional DGGRSs:
34+
DGGAL currently supports all nine DGGRSs described in [OGC API - DGGS Annex B](https://docs.ogc.org/is/21-038r1/21-038r1.html#annex-dggrs-def), as well as additional DGGRSs:
3435

3536
### Axis-aligned DGGRS in WGS84 latitude and longitude (simple bounding boxes)
3637

37-
* [GNOSIS Global Grid](https://docs.ogc.org/DRAFTS/21-038r1.html#ggg-dggrs): An axis-aligned quad-tree defined in WGS84 latitude and longitude, with special handling of polar regions achieving an approximate maximum of ~48% variance from median zone area, corresponding to the [OGC 2D Tile Matrix Set of the same name](https://docs.ogc.org/is/17-083r4/17-083r4.html#toc58)
38+
* [GNOSIS Global Grid](https://docs.ogc.org/is/21-038r1/21-038r1.html#ggg-dggrs): An axis-aligned quad-tree defined in WGS84 latitude and longitude, with special handling of polar regions achieving an approximate maximum of ~48% variance from median zone area, corresponding to the [OGC 2D Tile Matrix Set of the same name](https://docs.ogc.org/is/17-083r4/17-083r4.html#toc58)
3839

3940
### Equal-Area DGGRSs based on Icosahedral Projections (aperture 3 and 7 Hexagonal, aperture 4 and 9 Axis-Aligned Rhombic)
4041

4142
All of these Icosahedral DGGRSs achieve equal-area on the WGS84 ellipsoid, and are oriented with a first vertex of the icosahedron positioned at
4243
authalic latitude of _arctan(φ)_ (where φ is the golden ratio), and longitude 11.20°E, with second vertex due North, resulting in only one
4344
vertex / pentagon on land. Each of the 12 pentagons occupies 5/6th the area of a hexagon at the same refinement level.
4445

45-
The aperture 7 hexagonal grids and indexing should now be quite stable, and support for listing and resolving sub-zones is implemented for hexagonal ancestral zones.
46-
47-
**_Current limitation_**: _Support for listing and indexing sub-zones of **7H pentagonal** ancestral zones (all 12 level 0 zones and their centroid descendants) is not currently supported, but will be added in an upcoming version.
48-
In practice, the current lack of sub-zone support for pentagonal ancestral zones is only an issue for working with global low-resolution data,
49-
or at high resolution within close proximity to the 12 icosahedron vertices (within the pentagonal zones).
50-
All but one pentagon on land are avoided with a reference zone starting from 7H refinement level 9 (~1.26 km² area zones)._
46+
Starting from version 0.0.6, the aperture 7 hexagonal grids and indexing are fully functional, including support for listing and resolving sub-zones for both hexagonal and pentagonal ancestral zones.
5147

5248
#### Icosahedral Snyder Equal Area (ISEA) projection
5349

5450
([An Equal-Area Map Projection for Polyhedral Globes (1992)](https://doi.org/10.3138%2F27H7-8K88-4882-1752), or dodecahedron configuration (DVEA) of [Slice & Dice (2006)](https://www.tandfonline.com/doi/abs/10.1559/152304006779500687))
5551

5652
* **ISEA4R**: An equal area rhombic grid with a refinement ratio of 4 defined in the transformed into a 5x6 Cartesian space resulting in axis-aligned square zones
57-
* [ISEA9R](https://docs.ogc.org/DRAFTS/21-038r1.html#isea9r-dggrs): An equal area rhombic grid with a refinement ratio of 9 defined in the ISEA projection transformed into a 5x6 Cartesian space resulting in axis-aligned square zones
58-
* [ISEA3H](https://docs.ogc.org/DRAFTS/21-038r1.html#isea3h-dggrs): An equal area hexagonal grid with a refinement ratio of 3 defined in the ISEA projection
59-
* [ISEA7H](https://docs.ogc.org/DRAFTS/21-038r1.html#isea7h-dggrs): An equal area hexagonal grid with a refinement ratio of 7 defined in the ISEA projection
53+
* [ISEA9R](https://docs.ogc.org/is/21-038r1/21-038r1.html#isea9r-dggrs): An equal area rhombic grid with a refinement ratio of 9 defined in the ISEA projection transformed into a 5x6 Cartesian space resulting in axis-aligned square zones
54+
* [ISEA3H](https://docs.ogc.org/is/21-038r1/21-038r1.html#isea3h-dggrs): An equal area hexagonal grid with a refinement ratio of 3 defined in the ISEA projection
55+
* [ISEA7H](https://docs.ogc.org/is/21-038r1/21-038r1.html#isea7h-dggrs): An equal area hexagonal grid with a refinement ratio of 7 defined in the ISEA projection
6056
* **ISEA7H_Z7**: Same Discrete Global Grid Hierarchy (DGGH) and sub-zone order as ISEA7H, but using the Z7 indexing for interoperability with [DGGRID](https://github.com/sahrk/DGGRID) and [IGEO7](https://agile-giss.copernicus.org/articles/6/32/2025/).
6157

6258
**NOTE:** The DGGRID / IGEO7 interoperability of ISEA7H_Z7 relies on converting the authalic latitudes produced by DGGRID to geodetic latitudes to reference them to the WGS84 ellipsoid,
6359
and using the orientation which can be specified in DGGRID with `dggs_vert0_lon 11.20`, `dggs_vert0_lat 58.282525588538994675786` and `dggs_vert0_azimuth 0.0`.
6460
Efficient conversion from authalic latitude to geodetic latitudes is described by [Charles Karney's "On auxiliary latitudes"](https://arxiv.org/pdf/2212.05818)
6561
and can be performed using [Geographiclib](https://geographiclib.sourceforge.io/doc/library.html) or with the `authalicSetup()`, `latGeodeticToAuthalic()` and `latAuthalicToGeodetic()`
66-
[functions from DGGAL](https://github.com/ecere/dggal/blob/eC-core/src/projections/authalic.ec).
62+
[functions from DGGAL](https://github.com/ecere/dggal/blob/main/src/projections/authalic.ec).
6763

6864
#### Icosahedral Vertex-oriented great circle Equal Area (IVEA) projection
6965

7066
([Slice & Dice (2006)](https://www.tandfonline.com/doi/abs/10.1559/152304006779500687), or applying [Snyder 1992](https://doi.org/10.3138%2F27H7-8K88-4882-1752) to the dodecahedron (DSEA))
7167

7268
* **IVEA4R**: An equal area rhombic grid with a refinement ratio of 4 defined in the IVEA projection transformed into a 5x6 Cartesian space resulting in axis-aligned square zones, using the same global indexing and sub-zone ordering as for ISEA4R
73-
* [IVEA9R](https://docs.ogc.org/DRAFTS/21-038r1.html#ivea9r-dggrs): An equal area rhombic grid with a refinement ratio of 9 defined in the IVEA projection transformed into a 5x6 Cartesian space resulting in axis-aligned square zones, using the same global indexing and sub-zone ordering as for ISEA9R
74-
* [IVEA3H](https://docs.ogc.org/DRAFTS/21-038r1.html#ivea3h-dggrs): An equal area hexagonal grid with a refinement ratio of 3 defined in the IVEA projection, using the same global indexing and sub-zone ordering as for ISEA3H
75-
* [IVEA7H](https://docs.ogc.org/DRAFTS/21-038r1.html#ivea7h-dggrs): An equal area hexagonal grid with a refinement ratio of 7 defined in the IVEA projection, using the same global indexing and sub-zone ordering as for ISEA7H
69+
* [IVEA9R](https://docs.ogc.org/is/21-038r1/21-038r1.html#ivea9r-dggrs): An equal area rhombic grid with a refinement ratio of 9 defined in the IVEA projection transformed into a 5x6 Cartesian space resulting in axis-aligned square zones, using the same global indexing and sub-zone ordering as for ISEA9R
70+
* [IVEA3H](https://docs.ogc.org/is/21-038r1/21-038r1.html#ivea3h-dggrs): An equal area hexagonal grid with a refinement ratio of 3 defined in the IVEA projection, using the same global indexing and sub-zone ordering as for ISEA3H
71+
* [IVEA7H](https://docs.ogc.org/is/21-038r1/21-038r1.html#ivea7h-dggrs): An equal area hexagonal grid with a refinement ratio of 7 defined in the IVEA projection, using the same global indexing and sub-zone ordering as for ISEA7H
7672
* **IVEA7H_Z7**: Same DGGH and sub-zone order as IVEA7H, but using same Z7 indexing as for ISEA7H_Z7.
7773

7874
**NOTE:** This projection is superior to ISEA and RT(S)EA at avoiding perceptible cusps, resulting in more compact/regular zones.
@@ -94,18 +90,18 @@ and can be performed using [Geographiclib](https://geographiclib.sourceforge.io/
9490

9591
([HEALPix projection](https://arxiv.org/pdf/astro-ph/0409513))
9692

97-
* [HEALPix](https://docs.ogc.org/DRAFTS/21-038r1.html#HEALPix-dggrs): An equal area and axis-aligned grid with square zones topology and a refinement ratio of 4 defined in the HEALPix projection, using configuration Nφ/H = 4, Nθ/K = 3 (same as default [PROJ implementation](https://proj.org/en/stable/operations/projections/healpix.html)), the new indexing described in OGC API - DGGS Annex B, and scanline-based sub-zone ordering
98-
* [rHEALPix](https://docs.ogc.org/DRAFTS/21-038r1.html#rHEALPix-dggrs): An equal area and axis-aligned grid with square zones topology and a refinement ratio of 9 defined in the rHEALPix projection using 50° E prime meridian (equivalent to [PROJ implementation](https://proj.org/en/stable/operations/projections/rhealpix.html) with parameters `+proj=rhealpix +lon_0=50 +ellps=WGS84`), the [original hierarchical indexing](https://iopscience.iop.org/article/10.1088/1755-1315/34/1/012012), and scanline-based sub-zone ordering
93+
* [HEALPix](https://docs.ogc.org/is/21-038r1/21-038r1.html#HEALPix-dggrs): An equal area and axis-aligned grid with square zones topology and a refinement ratio of 4 defined in the HEALPix projection, using configuration Nφ/H = 4, Nθ/K = 3 (same as default [PROJ implementation](https://proj.org/en/stable/operations/projections/healpix.html)), the new indexing described in OGC API - DGGS Annex B, and scanline-based sub-zone ordering
94+
* [rHEALPix](https://docs.ogc.org/is/21-038r1/21-038r1.html#rHEALPix-dggrs): An equal area and axis-aligned grid with square zones topology and a refinement ratio of 9 defined in the rHEALPix projection using 50° E prime meridian (equivalent to [PROJ implementation](https://proj.org/en/stable/operations/projections/rhealpix.html) with parameters `+proj=rhealpix +lon_0=50 +ellps=WGS84`), the [original hierarchical indexing](https://iopscience.iop.org/article/10.1088/1755-1315/34/1/012012), and scanline-based sub-zone ordering
9995

10096
## libDGGAL API Documentation
10197

10298
The API documentation can be [found here](https://dggal.org/docs/html/dggal/Classes/DGGRS.html).
10399

104100
The `DGGRS` class provides most of the functionality of the library, allowing to resolve DGGRS zones by textual ID to a unique 64-bit zone integer identifier (`DGGRSZone`).
105101
The geometry and sub-zones of a particular zone can also be queried.
106-
The concept of [sub-zones](https://docs.ogc.org/DRAFTS/21-038r1.html#term-sub-zone) is key to encoding both vector and raster geospatial data quantized to a DGGRS.
102+
The concept of [sub-zones](https://docs.ogc.org/is/21-038r1/21-038r1.html#term-sub-zone) is key to encoding both vector and raster geospatial data quantized to a DGGRS.
107103
The DGGAL library also allows to resolve a sub-zone index at a particular depth from a parent zone, allowing to read DGGS-optimized data such as
108-
[DGGS-JSON](http://dggs-json.org) and [DGGS-JSON-FG](https://docs.ogc.org/DRAFTS/21-038r1.html#rc_data-dggs-jsonfg).
104+
[DGGS-JSON](http://dggs-json.org) and [DGGS-JSON-FG](https://docs.ogc.org/is/21-038r1/21-038r1.html#rc_data-dggs-jsonfg).
109105

110106
## Language bindings
111107

@@ -514,7 +510,7 @@ sub-zone B6-5-C not found within parent A4-0-A
514510

515511
#### `togeo`
516512

517-
Converts [DGGS-JSON](http://dggs-json.org) (and eventually [DGGS-JSON-FG](https://docs.ogc.org/DRAFTS/21-038r1.html#rc_data-dggs-jsonfg) and [UBJSON](https://ubjson.org/) variants) to GeoJSON
513+
Converts [DGGS-JSON](http://dggs-json.org) (and eventually [DGGS-JSON-FG](https://docs.ogc.org/is/21-038r1/21-038r1.html#rc_data-dggs-jsonfg) and [UBJSON](https://ubjson.org/) variants) to GeoJSON
518514
to facilitate interoperability with traditional GIS software / software not aware of the DGGRS.
519515

520516
https://maps.gnosis.earth/ogcapi/collections/sentinel2-l2a/dggs/ISEA3H/zones/G7-67252-B/data.json?zone-depth=8&datetime=2022-10-28&properties=B08

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["setuptools", "wheel", "cffi>=1.0.0", "ecdev>=0.0.5post1", "importlib_metadata; python_version<'3.8'"]
3+
build-backend = "setuptools.build_meta"

0 commit comments

Comments
 (0)