Repository navigation
feat: Add a GeoKey-to-CRS conformance corpus and CT method table - #84
Merged
Merged
Conversation
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…pers Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
97 GDAL-written fixtures, the manifest of GeoKeys written and CRS read back, and cached epsg.io JSON for the coded cases. The generator sends a User-Agent because epsg.io rejects urllib's default one. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Transcribed from libgeotiff GTIFFetchProjParms and GDAL GTIFGetOGISDefn with line citations; method names and parameter sets are checked against what GDAL read back for each fixture. Adds an eqc_lat0 fixture to pin how PROJ treats the latitude of origin for Equidistant Cylindrical. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Also formats the new modules with ruff format. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Review findings: libgeotiff reads ProjScaleAtNatOrigin only for CT_Mercator, and PROJ sets both Polar Stereographic axes south or north by the sign of the latitude. The README also gains a comparison rule for the core (match by EPSG code, dropped zeros, tolerance). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
kylebarron
commented
Oct 26, 2026
|
|
||
| GDAL/PROJ is the oracle. For every case, GDAL writes the file and then reads it back; the manifest records both the raw GeoKeys GDAL wrote and the CRS GDAL/PROJ reads from them. A reader is conformant when, for every tested fixture, the CRS it builds equals the one in the manifest. | ||
|
|
||
| Consumers today: [async-geotiff](https://github.com/developmentseed/async-geotiff) (Python, pyproj) and the GeoTIFF package in [deck.gl-raster](https://github.com/developmentseed/deck.gl-raster) (TypeScript, no PROJ database). The design is written up in async-geotiff under `dev-docs/specs/2026-10-26-geokey-crs-conformance-design.md`. |
Member
Author
There was a problem hiding this comment.
We should include the design for the conformance corpus as a spec in this repo, checked in
Member
Author
There was a problem hiding this comment.
Note
This comment was written by Claude (Claude Code), not by @kylebarron.
Done in 28fc95b: the design document is checked in as crs/DESIGN.md (verbatim copy of the async-geotiff spec, which also covers the builder that consumes this corpus), and this README paragraph now links to it.
🤖 Written by Claude Code
Member
Author
There was a problem hiding this comment.
Note
This comment was written by Claude (Claude Code), not by @kylebarron.
Moved to dev-docs/specs/2026-10-26-geokey-crs-conformance-design.md in the latest commit; the README link follows it.
🤖 Written by Claude Code
PROJ's projected coordinates differ in the last digits between macOS arm64 and Linux x86_64, which made check.sh fail in CI. Round x and y to millimetres, and keep the committed value when a regeneration moves it by less than a millimetre so a rounding boundary cannot flip either. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…rounding Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR was written by Claude (Claude Code), not by @kylebarron.
Adds
crs/, a conformance corpus for readers that build a CRS from GeoTIFF GeoKeys, with GDAL/PROJ as the oracle. Consumers: async-geotiff (Python) now, the deck.gl-raster GeoTIFF package (TypeScript) later. Design:dev-docs/specs/2026-10-26-geokey-crs-conformance-design.mdin async-geotiff.What is in it
crs/cases.py: 98 cases. One perProjCoordTransGeoKeycode GDAL can write, each distinct key arrangement GDAL emits for it, US survey and international feet, grads, EPSG-coded and user-defined datums and ellipsoids, a sphere, TOWGS84, Greenwich/named/user-defined/EPSG-coded prime meridians,ProjectionGeoKeywithout a CT code,ESRI PE Stringcitations, 46 EPSG codes plusESRI:54009, and Equal Earth (which GDAL cannot encode).crs/generate_crs.py(pixi run generate-crs): writes each fixture with rasterio (or tifffile for one hand-built key set), reads it back withGDAL_PAM_ENABLED=NO, and writescrs/manifest.json: the raw GeoKeys GDAL wrote, GDAL's PROJJSON and proj4, a name-freecorein degrees/metres for readers without a PROJ database, and a test point. Deterministic;scripts/check.shnow runs it.crs/epsg/*.json: cachedepsg.ioresponses for the coded cases, so TypeScript tests can run offline.crs/geotiff-ct-methods.json: for every CT code, the PROJ/EPSG method and how each parameter is read from GeoKeys (key fallback order, kind, default), transcribed from libgeotiffGTIFFetchProjParmsand GDALGTIFGetOGISDefnwith line citations, plus the three variant rules (Mercator A/B, Polar Stereographic A/B as PROJ decides it, HOM A/B/Laborde as separate codes). Tests check it against what GDAL actually read back for each fixture.crs/README.md: schema of the manifest and the table, how to read the table, and the GDAL/PROJ behaviours the corpus documents.Flagged rows (recorded, not tested)
eqearth: GDAL writes no GeoKeys.stere_polar_scaled_wkt: Polar Stereographic off the pole with scale 0.9 reads back as a non-EPSGPolar_Stereographicmethod PROJ cannot export.Notes
pyprojis now an explicit pypi dependency (it was transitive). The lock was updated with pixi 0.82.1, matching CI.scripts/info.shskipscrs/; the manifest documents those files.tmerc_towgs84,omerc_variant_a,omerc_variant_b,somerc) need GeoKeys that async-tiff exposes only from feat: Expose GeogTOWGS84GeoKey and ProjRectifiedGridAngleGeoKey async-tiff#368 onward.generator.🤖 Written by Claude Code
🤖 Generated with Claude Code