You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've rewritten my project from scratch, and I can say I'm using proj4 v2.20.3 (this is the version supposed to fix this issue) everywhere. Unless there's an old version hidden somewhere...
I'd been searching for a way to force a reprojection to 4326 using RasterReprojector for this very specific case, but no success. Even forcing the wkt2 definition of the CRS. I always get the same vertical shift regardless of the approach. I just can't find what makes this specific raster fail with deck.gl-raster.
I've been running through the issues in this repo, proj4, and deck.gl Mapbox overlay, just in case. No clue.
@AbelVM you still haven't provided any reproducible example or data file
My fault! I've been deep in #215, working on a plugin, and I took a lot of things for granted when posting the issue. For example, providing the offending raster file 😅 . Thank you for the research!!
As proj4js v2.20.3 was, in theory, blameless, I was looking into deck.gl Mapbox Overlay, as there are some old issues there about overlay position regarding interleaving.
I'm moving to the proj4js issue to check the info there and go try a PR
EDIT Ok, it looks like I'm late, and it's already fixed with proj4js/proj4js#553
Activity
kylebarron commentedon Mar 5, 2026
Can you check what proj4.js version you're using. cc proj4js/proj4js#545 and proj4js/proj4js#546
Also, as it is your issue is not reproducible at all
kylebarron commentedon Mar 5, 2026
Ideally we wouldn't perform any CPU reprojection for 3857 inputs, see #153 and #41.
Let me know if you'd like to work on that.
It should be similar to how the MVT layer renders from local web mercator coordinates instead of doing CPU work to convert to screen space.
https://github.com/visgl/deck.gl/blob/2edcc0dde1bbc9a93fdfc4b52dfea0daf1f3c68b/modules/geo-layers/src/mvt-layer/mvt-layer.ts#L265-L270
AbelVM commentedon Mar 6, 2026
I've rewritten my project from scratch, and I can say I'm using proj4 v2.20.3 (this is the version supposed to fix this issue) everywhere. Unless there's an old version hidden somewhere...
I'd been searching for a way to force a reprojection to 4326 using
RasterReprojectorfor this very specific case, but no success. Even forcing the wkt2 definition of the CRS. I always get the same vertical shift regardless of the approach. I just can't find what makes this specific raster fail with deck.gl-raster.I've been running through the issues in this repo, proj4, and deck.gl Mapbox overlay, just in case. No clue.
The raster info looks ok, and it renders flawlessly in QGIS or in this maplibre plugin example https://labs.geomatico.es/maplibre-cog-protocol/custom-color.html#10.28/42.2571/2.9413
➜ gdalinfo sentinel2.tif Driver: GTiff/GeoTIFF Files: sentinel2.tif sentinel2.tif.aux.xml Size is 2560, 1280 Coordinate System is: PROJCRS["WGS 84 / Pseudo-Mercator", BASEGEOGCRS["WGS 84", ENSEMBLE["World Geodetic System 1984 ensemble", MEMBER["World Geodetic System 1984 (Transit)"], MEMBER["World Geodetic System 1984 (G730)"], MEMBER["World Geodetic System 1984 (G873)"], MEMBER["World Geodetic System 1984 (G1150)"], MEMBER["World Geodetic System 1984 (G1674)"], MEMBER["World Geodetic System 1984 (G1762)"], MEMBER["World Geodetic System 1984 (G2139)"], MEMBER["World Geodetic System 1984 (G2296)"], ELLIPSOID["WGS 84",6378137,298.257223563, LENGTHUNIT["metre",1]], ENSEMBLEACCURACY[2.0]], PRIMEM["Greenwich",0, ANGLEUNIT["degree",0.0174532925199433]], ID["EPSG",4326]], CONVERSION["Popular Visualisation Pseudo-Mercator", METHOD["Popular Visualisation Pseudo Mercator", ID["EPSG",1024]], PARAMETER["Latitude of natural origin",0, ANGLEUNIT["degree",0.0174532925199433], ID["EPSG",8801]], PARAMETER["Longitude of natural origin",0, ANGLEUNIT["degree",0.0174532925199433], ID["EPSG",8802]], PARAMETER["False easting",0, LENGTHUNIT["metre",1], ID["EPSG",8806]], PARAMETER["False northing",0, LENGTHUNIT["metre",1], ID["EPSG",8807]]], CS[Cartesian,2], AXIS["easting (X)",east, ORDER[1], LENGTHUNIT["metre",1]], AXIS["northing (Y)",north, ORDER[2], LENGTHUNIT["metre",1]], USAGE[ SCOPE["Web mapping and visualisation."], AREA["World between 85.06°S and 85.06°N."], BBOX[-85.06,-180,85.06,180]], ID["EPSG",3857]] Data axis to CRS axis mapping: 1,2 Origin = (283734.248994573950768,5224623.757348367944360) Pixel Size = (38.218514142588127,-38.218514142588127) Metadata: AREA_OR_POINT=Area Image Structure Metadata: LAYOUT=COG COMPRESSION=DEFLATE INTERLEAVE=PIXEL Tiling Scheme: NAME=GoogleMapsCompatible ZOOM_LEVEL=12 Corner Coordinates: Upper Left ( 283734.249, 5224623.757) ( 2d32'55.78"E, 42d25'24.44"N) Lower Left ( 283734.249, 5175704.059) ( 2d32'55.78"E, 42d 5'53.60"N) Upper Right ( 381573.645, 5224623.757) ( 3d25'39.84"E, 42d25'24.44"N) Lower Right ( 381573.645, 5175704.059) ( 3d25'39.84"E, 42d 5'53.60"N) Center ( 332653.947, 5200163.908) ( 2d59'17.81"E, 42d15'39.78"N) Band 1 Block=256x256 Type=UInt16, ColorInterp=Gray Min=0.000 Max=9586.000 Overviews: 1280x640, 640x320, 320x160, 160x80 Metadata: STATISTICS_APPROXIMATE=YES STATISTICS_MAXIMUM=9586 STATISTICS_MEAN=2073.031171875 STATISTICS_MINIMUM=0 STATISTICS_STDDEV=1419.0319875205 STATISTICS_VALID_PERCENT=100 Band 2 Block=256x256 Type=UInt16, ColorInterp=Undefined Min=0.000 Max=11685.000 Overviews: 1280x640, 640x320, 320x160, 160x80 Metadata: STATISTICS_APPROXIMATE=YES STATISTICS_MAXIMUM=11685 STATISTICS_MEAN=2756.07625 STATISTICS_MINIMUM=0 STATISTICS_STDDEV=1875.547791721 STATISTICS_VALID_PERCENT=100 Band 3 Block=256x256 Type=UInt16, ColorInterp=Undefined Min=0.000 Max=14719.000 Overviews: 1280x640, 640x320, 320x160, 160x80 Metadata: STATISTICS_APPROXIMATE=YES STATISTICS_MAXIMUM=14719 STATISTICS_MEAN=3698.118984375 STATISTICS_MINIMUM=0 STATISTICS_STDDEV=2687.6226017062 STATISTICS_VALID_PERCENT=100 Band 4 Block=256x256 Type=UInt16, ColorInterp=Undefined Min=0.000 Max=17762.000 Overviews: 1280x640, 640x320, 320x160, 160x80 Metadata: STATISTICS_APPROXIMATE=YES STATISTICS_MAXIMUM=17762 STATISTICS_MEAN=3962.06484375 STATISTICS_MINIMUM=0 STATISTICS_STDDEV=3459.0320173716 STATISTICS_VALID_PERCENT=100 Band 5 Block=256x256 Type=UInt16, ColorInterp=Undefined Min=0.000 Max=20322.000 Overviews: 1280x640, 640x320, 320x160, 160x80 Metadata: STATISTICS_APPROXIMATE=YES STATISTICS_MAXIMUM=20322 STATISTICS_MEAN=5654.497421875 STATISTICS_MINIMUM=0 STATISTICS_STDDEV=4501.7019889176 STATISTICS_VALID_PERCENT=100 Band 6 Block=256x256 Type=UInt16, ColorInterp=Undefined Min=0.000 Max=23545.000 Overviews: 1280x640, 640x320, 320x160, 160x80 Metadata: STATISTICS_APPROXIMATE=YES STATISTICS_MAXIMUM=23545 STATISTICS_MEAN=9435.824609375 STATISTICS_MINIMUM=0 STATISTICS_STDDEV=7208.0362097044 STATISTICS_VALID_PERCENT=100 Band 7 Block=256x256 Type=UInt16, ColorInterp=Undefined Min=0.000 Max=30205.000 Overviews: 1280x640, 640x320, 320x160, 160x80 Metadata: STATISTICS_APPROXIMATE=YES STATISTICS_MAXIMUM=30205 STATISTICS_MEAN=11041.038046875 STATISTICS_MINIMUM=0 STATISTICS_STDDEV=8556.8100620138 STATISTICS_VALID_PERCENT=100 Band 8 Block=256x256 Type=UInt16, ColorInterp=Undefined Min=0.000 Max=30162.000 Overviews: 1280x640, 640x320, 320x160, 160x80 Metadata: STATISTICS_APPROXIMATE=YES STATISTICS_MAXIMUM=30162 STATISTICS_MEAN=11178.05140625 STATISTICS_MINIMUM=0 STATISTICS_STDDEV=8726.8071197683 STATISTICS_VALID_PERCENT=100 Band 9 Block=256x256 Type=UInt16, ColorInterp=Undefined Min=0.000 Max=30846.000 Overviews: 1280x640, 640x320, 320x160, 160x80 Metadata: STATISTICS_APPROXIMATE=YES STATISTICS_MAXIMUM=30846 STATISTICS_MEAN=11792.508984375 STATISTICS_MINIMUM=0 STATISTICS_STDDEV=9231.8738627418 STATISTICS_VALID_PERCENT=100 Band 10 Block=256x256 Type=UInt16, ColorInterp=Undefined Min=0.000 Max=28367.000 Overviews: 1280x640, 640x320, 320x160, 160x80 Metadata: STATISTICS_APPROXIMATE=YES STATISTICS_MAXIMUM=28367 STATISTICS_MEAN=9832.676015625 STATISTICS_MINIMUM=0 STATISTICS_STDDEV=8131.3724134878 STATISTICS_VALID_PERCENT=100 Band 11 Block=256x256 Type=UInt16, ColorInterp=Undefined Min=0.000 Max=23444.000 Overviews: 1280x640, 640x320, 320x160, 160x80 Metadata: STATISTICS_APPROXIMATE=YES STATISTICS_MAXIMUM=23444 STATISTICS_MEAN=6536.791484375 STATISTICS_MINIMUM=0 STATISTICS_STDDEV=5775.7604591468 STATISTICS_VALID_PERCENT=100 Band 12 Block=256x256 Type=UInt16, ColorInterp=Undefined Min=0.000 Max=32156.000 Overviews: 1280x640, 640x320, 320x160, 160x80 Metadata: STATISTICS_APPROXIMATE=YES STATISTICS_MAXIMUM=32156 STATISTICS_MEAN=11915.650625 STATISTICS_MINIMUM=0 STATISTICS_STDDEV=9331.8555716746 STATISTICS_VALID_PERCENT=100AbelVM commentedon Mar 6, 2026
If I reproject the raster to some random (but valid) CRS, it works as expected. Only 3857 fails
kylebarron commentedon Mar 6, 2026
@AbelVM you still haven't provided any reproducible example or data file
kylebarron commentedon Mar 6, 2026
Ok I found the file from your upstream example.
I converted to a 3-band RGB in COG format with
Checking in Python
Now first to validate our TypeScript geotiff parser is inferring the bounding box correct, we can add some
console.logs in ouronGeoTIFFLoadcallback.Ok, so we're parsing the GeoTIFF tags correctly. Now lets check the WGS84 bounding box inferred by
getGeographicBoundsNow let's check against Python
Let's put a
console.logintogetGeographicBoundsSee, this is off by .2 degrees of latitude. This points to a projection error in proj4js. Now we can move on to creating an issue in proj4js.
^^ This is the kind of analysis that's helpful for reproducing an issue. Uploading screenshots (alone) isn't sufficient to help diagnose a problem.
kylebarron commentedon Mar 6, 2026
There was an issue created in proj4js a few days ago: proj4js/proj4js#548
The maintainer commented there
@AbelVM since you're currently hitting this, would you be able to make a PR to proj4js to fix this bug? That would be very helpful.
AbelVM commentedon Mar 7, 2026
My fault! I've been deep in #215, working on a plugin, and I took a lot of things for granted when posting the issue. For example, providing the offending raster file 😅 . Thank you for the research!!
As proj4js v2.20.3 was, in theory, blameless, I was looking into deck.gl Mapbox Overlay, as there are some old issues there about overlay position regarding interleaving.
I'm moving to the proj4js issue to check the info there and go try a PR
EDIT Ok, it looks like I'm late, and it's already fixed with proj4js/proj4js#553
kylebarron commentedon Mar 7, 2026
https://github.com/proj4js/proj4js/releases/tag/v2.20.4 is released so it looks like this should be fixed now
Is your work on this open source? We'll have first-party custom visualization in this library, but I might start work on Zarr first.
AbelVM commentedon Mar 7, 2026
Yes! I'm fine tuning it right now and will publish it later 🤓
fix: Bump proj4 to fix web mercator projection (#346)