Repository navigation
fix: support Cylindrical Equal Area CRSes - #791
Conversation
GeoTIFFs in a Cylindrical Equal Area CRS without an EPSG code, such as World Cylindrical Equal Area (ESRI:54034), failed to load with "Unsupported coordinate transformation type: 28". GDAL writes these as a user-defined projected CRS with ProjMethodGeoKey 28, libgeotiff's CT_CylindricalEqualArea, which crsFromGeoKeys didn't map. Mapping it to a "Lambert Cylindrical Equal Area" conversion alone isn't enough: wkt-parser keeps that method name (or "Cylindrical_Equal_Area" in WKT1), but proj4 registers the projection only as "cea" and reads its standard parallel from lat_ts, not lat1. parseWkt now renames the method and copies the standard parallel, which also fixes EPSG-coded CRSes such as EASE-Grid 2.0 (EPSG:6933) that epsgResolver fetches from epsg.io. Co-Authored-By: Claude Opus 5.5 <[email protected]>
kylebarron
left a comment
There was a problem hiding this comment.
I think we need to overhaul how we handle custom CRSes; this is just a band-aid
This feels so hacky :/ is there any less-hacky solution here? |
|
Note This comment was written by Claude (Claude Code), not by @kylebarron.
The
Options:
🤖 Written by Claude Code |
… rewriting parseWkt's output proj4 knows the projection only as "cea", which reads its standard parallel from lat_ts; wkt-parser keeps the WKT method name and puts the standard parallel in lat1. Rather than rewrite parseWkt's output, register proj4's cea under the WKT method names, with an init that reads lat1. A workaround until proj4js and wkt-parser handle both. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Note This comment was written by Claude (Claude Code), not by @kylebarron. Went with option 2 for now, and the upstream fixes are on branches. Upstream:
Once those land and we bump, the registration can go. 🤖 Written by Claude Code |
…hes (#47) Disabling every patch and re-testing on 0.9.0 showed these three make no difference: a deep-zoom Vancouver view and a global Mollweide COG render identically without them, and the deck.gl-geotiff WKT fallback never ran (per #39). The deck.gl-raster one also broke culling: it padded each tile's bounding box to >= 1 common-space unit (~50 km at 49N), so a static deep zoom selected and fetched ~38k tiles (#41). Keep the geotiff and proj patches: without them the Colombia CEA COG (#28) fails. They are fixed upstream in developmentseed/deck.gl-raster#791 but not yet released. Co-authored-by: Claude Opus 5.5 <[email protected]>
Note
This PR was written by Claude (Claude Code), not by @kylebarron.
GeoTIFFs in a Cylindrical Equal Area CRS without an EPSG code, such as the World Cylindrical Equal Area (ESRI:54034) COG in #649, failed to load with
Unsupported coordinate transformation type: 28. GDAL writes these as a user-defined projected CRS withProjMethodGeoKey28, libgeotiff'sCT_CylindricalEqualArea, whichcrsFromGeoKeysdidn't map. The file has no WKT and no EPSG code, so theepsgResolverfallback #649 proposes can't help it;parseWktdoesn't throw for an unknown method in any case, since that failure surfaces later, inproj4().Mapping the GeoKeys alone isn't enough either: proj4 registers this projection only as
cea, which reads its standard parallel fromlat_ts, while wkt-parser keeps the WKT/PROJJSON method name and puts the standard parallel inlat1. So EPSG-coded CRSes such as EASE-Grid 2.0 (EPSG:6933) from epsg.io failed too.Changes
crsFromGeoKeysmapsProjMethodGeoKey28 to a "Lambert Cylindrical Equal Area" conversion, reading the same GeoKeys as libgeotiff.@developmentseed/projregisters proj4'sceaunder the names wkt-parser gives it, "Lambert Cylindrical Equal Area" (WKT2 and PROJJSON) and "Cylindrical_Equal_Area" (WKT1), with aninitthat reads the standard parallel fromlat1.parse-wkt.tsruns the registration when it loads. It's a workaround until proj4js registers the names and wkt-parser puts the standard parallel inlat_ts.Tests
epsgResolverwhenparseWktthrows for an unknown projection method #649 file's GeoKeys and from World Behrmann's (30° standard parallel); an unmapped coordinate transformation type still throws the original error.cs2cs). Both fail without the registration.main; the "still throws" test guards existing behavior.COGLayer's CRS path with the built packages, the Fall back toepsgResolverwhenparseWktthrows for an unknown projection method #649 file's geographic bounds matchgdalinfo's corners.Closes #649
🤖 Written by Claude Code