Open chingchai opened 2 years ago
Hey, I'm seeing a very similar issue. My process is the same: gdalwarp to 3857, then rgbify.
Check out these edges that appear (left and center are rgbify, right is mapbox online for reference):
Here are the PNGs. rgbify:
From mapbox:
Using the tiles in 3D yields very similar results to what you're seeing:
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. gdal2tiles.py **-r near** --xyz -z 10-20 -tilesize=512 rgbify_input.tif ./tiles/
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.