[gdal-dev] Re: [SoC] SoC GDAL2Tiles: Status Report

Frank Warmerdam warmerdam at pobox.com
Thu Jul 3 11:26:40 EDT 2008


Klokan Petr Přidal wrote:
> Hi,
> 
> My SoC project description: http://trac.osgeo.org/gdal/wiki/SoCGDAL2Tiles
> 
> There are things we (gdal-dev) need to decide:
> 
> 1) Clearly define the role of GDAL2Tiles.
> The functionality is overlaying with gdal_retile.py utility.
> In my opinion gdal2tiles should be more gdal2webtiles ;-) -
> so it should concentrate more on TMS and Google Maps tiles
> (Spherical Mercator tiles), generation of a web viewer and KML
> SuperOverlay for Google Earth.
> 
> Is there a need for generation tiles in formats other then PNG/JPEG
> with tile type of bands other then RGB(A) 8-bit?
> What about functionality like generation shape file tileindex (for
> MapServer) or world files for produced tiles?
> The tile size is in the world of web tiles mostly fixed on 256x256
> (just iPhone needs smaller version 128x128, and NASA WorldWind has
> 512x512). I guess size of tiles should be variable (now GDAL2Tiles
> uses fixed 256).
> 
> Utility gdal_retile implements cutting into tiles as well, where is
> the border between those two utilities?

Klokan,

I would agree that gdal2tiles should focus on web ready tile tree
output rather than attempting to be a universal tile production script.

I must confess I'm not exactly clear on the boundary between
gdal2tiles and gdal_retile.  There might end up being some things that
could be done with either, but the key (I think) is to ensure that
web tile serving can be accomplished smoothly with gdal2tiles.py.

> 2) How to improve quality of rendering - scale algorithm is now nearest
> neighbour because GDAL2Tiles utilize GDAL's ReadRaster function, which
> should be fastest.
> Either I will query from GDAL bigger region with nearest
> algorithm and then downscale it inside of the NumPy Array, or I will
> switch to warping API (I will need that anyway for warping between map
> projections).
> 
> Does it make sense to implement the scale down in memory - because of
> speed, or I should not bother
> with that and simply use warping api, same as gdal_retile do? FrankW?

I'm not clear on how the whole process works.  I will warn that the
warp api resampling kernels are generally not suitable for massive
downscaling (as presumably is used for the higher level overviews).
Instead, something like averaging may be better.  You could accomplish
this in memory with numpy, or possibly, use the averaging logic used
for "gdaladdo" (the gdal overview builder).  I will be exposing this
logic through swig soon in trunk for other purposes.

> 3) I would like to have support for possibly all input data in
> gdal2tiles, it means to include for example functionality from pct2rgb.py into
> GDAL2TIles (people are complaing and reporting that as a bug).
> Same with the conversion from 16-bit and 1-bit bands into 8-bit.

I agree that "pct2rgb" and "scaling to 8bit" logic is desirable in
gdal2tiles.

> 4) Improvement on the speed of gdal2tiles - I thought about generating
> metatiles - something like 5 tiles with one request - in the row
> probably - to improve the speed on sequential-only drivers.
> JPEG is now horribly slow for example, any tips how to make GDAL2Tiles faster?

I can't answer off hand.  I'd like to see you spend some time analysing
and describing the performance bottlenecks in the current process and
then I might have useful advice.

For instance, is it jpeg read or writing that is slow?  Are you re-reading
input jpegs many times?  Are you reading small sections out of big jpegs?

> 5) I would like to see GDAL2TIles be able to warp the tiles -
> from different projections as well to remove the need to pre-process
> temporary file with gdalwarp.

I would expect this to be a substantial complication.  One alternative
might be to use a warped VRT as input to gdal2tiles (or generated with
gdal2tiles).

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org



More information about the gdal-dev mailing list