[GIS] gdal2tiles doesn’t use resampling method correct

gdalgdal2tilesmapniktiles

I'm using gdal2tiles to create tiles from MODIS satellite imagery (250 m resolution) and I have noticed that I get the same bad result if I use -r near or -r bilinear (or lanczos for that matter). See attached image.

gdal2tiles generated tile

If I do the same generating with Mapnik and generate_tiles.py the images looks so much better.

Mapnik generated tile

The source file has a smaller resolution than the output tile, but I guess that's what the resampling bilinear (or lanczos) should "take care of"? Now it seems like gdal2tiles only scales the image without adding any resampling method?

I've tried to generate the tiles from geotiffs and jpegs (with jgw) but it's all the same.

The reason I want to use gdal2tiles rather than generate_tiles.py with Mapnik is that gdal2tiles are so much faster. Look here: The fastest way of generating tiles from raster?

Best Answer

GDAL2Tiles has been my student project I did for Google during SoC programme. There are some shortcuts in the used workflow made because of limits of the Python binding to the GDAL core.

During the last years we have completely reimplemented GDAL2Tiles into C/C++, fixed all known bugs and added a ton of new features.

Try http://www.maptiler.com/ and see the difference - both in quality, size of the produced tiles as well as the required speed to render the raster. You can merge multiple files into a seamless layer, render into SQLite packages, upload efficiently to Amazon S3, host tiles as WMTS with open-source projects, etc.

MapTiler comes with the GUI as well as command line (in the Pro version). It has the option for resampling which runs just as it should.

Related Question