I have been converting a raster consisting of 5m pixels to xyz tiles with PNG format in order to be consumed by Mapbox as a layer. I have been using gdal2tiles.py to achieve this and have been hosting them in S3, however I have noticed that there are some pixels missing when comparing the view on Mapbox compared to when viewing the raster in QGIS.
My process has been:
- Apply qml style to raster in QGIS
- Export raster as geotiff file from QGIS with the following settings
(compression was set to high and I removed the field: PREDICTOR=2
- Run gdal2tiles.py like this:
gdal2tiles.py {file} --xyz --zoom=8-18 --processes={cores} --exclude
I put the above in because it could be something in my process that is causing the inaccuracies.
What is the most accurate way to generate a tileset from a raster file? I am curious about things like whether tms
more accurate than xyz
, or if there is a more accurate tool than gdal2tiles.py
, or if I have done something to cause these inaccuracies myself.
Here are some images to illustrate:
The first picture is how it looks in Mapbox, the second in QGIS. You can see in QGIS there are 4 pixels up, whereas in Mapbox there are only 3.