-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error occurred over-altitude terrain RGB raster tileset in Mapbox GL JS #33
Comments
Hey, for whoever runs into this in the future: The problem is in gdal2tiles, where it resamples the images using conventional algorithms for image resizing (nearest neighbor, bilinear, etc). However, since terrainpng pixels are not really colors, but encoded elevation values, the resampling actually creates problems in the data - See images above. I couldn't find any method that works with GDAL directly. Ended up tiling directly from python with rasterio, then converting the data to terrainpng per tile. |
Quick note:
|
Using nearest neighbor resampling when computing tiles via gdal2tiles will prevent interpolation between pixels. e.g. This won't produce spiking along boundaries where red and green band values change, but it instead will result in a blocky appearance at high zoom levels. Likely acceptable for some use cases. |
Hi, I use my DEM generate from Drone using OpenDroneMap. After that, I use gdal_warp to re-project my DSM to EPSG:3857 and transform the greyscale data into the RGB data using rio-rgbify and last step i use gdal2tiles.py to generate xyz tiles. But i got error when add tiles layer to Mapbox GL JS as the picture shown below.
The text was updated successfully, but these errors were encountered: