feat: Add user-defined Oblique Stereographic CRS fixture - #71
Merged
Merged
Conversation
128x128 extract of a source.coop/dataforcanada COG whose CRS (New Brunswick Stereographic, equivalent to EPSG:2953) is stored as user-defined geo keys with the projection origin in ProjNatOrigin*/ProjScaleAtNatOrigin rather than ProjCenter*. Parsers that read the ProjCenter* keys for CT_ObliqueStereographic place the image near (0, 0). From source-cooperative/cog-viewer#40 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Regenerating the fixture with a plain gdal_translate silently writes ProjectedCSTypeGeoKey = 2953 instead of the user-defined keys the fixture exists to exercise. Read the raw GeoKeys with async-tiff and assert the full set, and run pytest in CI. async-tiff comes from PyPI because conda-forge has no osx-arm64 build. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
kylebarron
commented
Sep 25, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <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.
Upstream PR source-cooperative/cog-viewer#40 has a GeoTIFF that doesn't render correctly because we don't parse the CRS correctly.
Change list
Note
Written by Claude (Claude Code) on behalf of @kylebarron, not by @kylebarron.
From source-cooperative/cog-viewer#40
Adds
real_data/source-coop-dataforcanada/O2308000_7586000_cog.tif, a 128x128 extract of a source.coop/dataforcanada COG (44 KB).The CRS is New Brunswick Stereographic (equivalent to EPSG:2953), but it is stored as user-defined geo keys (
ProjectedCSTypeGeoKey = 32767,ProjCoordTransGeoKey = CT_ObliqueStereographic). The projection origin is inProjNatOriginLatGeoKey/ProjNatOriginLongGeoKey/ProjScaleAtNatOriginGeoKey. A parser that reads theProjCenter*keys for this method gets an origin of (0, 0) and puts the image near Null Island.A plain
gdal_translateof the source doesn't keep those keys: GDAL identifies the CRS as EPSG:2953 by name and writesProjectedCSTypeGeoKey = 2953instead. The extract assigns the same WKT with thePROJCS/GEOGCSauthority codes removed. All 19 geo keys in the extract match the source file. The README has the exact command and thelistgeooutput.pixi run checkpasses locally.🤖 Written by Claude Code