Pergunta

Gdal2tiles or maptiler generates tiles with tile size of 256x256 px.

I have a non-square image with resolution of 1984x3062.

Processing this non-square image, gdal2tiles generates tiles of 256x256 but with transparent portions to compensate the non-square size, this causes leafletjs to work improperly.

So I would like to find a solution by which I can generate custom tile sizes with gdal2tiles or maptiler. Or some other solution that would help to remove the extra transparent part from the tiles.

Foi útil?

Solução

If you use the latest version of MapTiler available at http://www.maptiler.com/ it will directly render a sample leaflet.html viewer for you.

Both mercator tiles or raster specific tiles (for images without georeference) are supported. The MapTiler Pro has also an option for specifying custom size of the tiles.

An alternative would be to render Zoomify tiles. Leaflet can display Zoomify tiles as well. Zoomify tiles are JPEG, and do not contain extra transparent part.

See: http://blog.thematicmapping.org/2013/06/showing-zoomify-images-with-leaflet.html and code at https://github.com/turban/Leaflet.Zoomify

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top