Setting zoomlevels with gdalwarp?

Jeff Dege jdege at KORTERRA.COM
Tue Oct 24 12:34:09 EDT 2006


As I understand it, I will get the best performance with raster layers
if the raster image files match the map display image pixel-for-pixel.
So I want to use gdalwarp to convert the raster image files so that the
will match the display image at the deepest zoom level.  (After which, I
will add overviews with gdaladdo).

The question is, how?

I either need to set the resolution of the raster image files with
dgalwarp so that it matches my zoom level, or I need to set my zoom
level so that it matches the resolution of the raster image files.

The question is - what's the math for the conversion from zoom to
resolution?

Suppose, for example, I want might deepest zoom to be around 1:2000.
And I have a couple of hundred jpeg raster image files, with coordinates
in decimal degrees, and pixel sizes of (0.00001279,-0.00000900).

Gdalwarp seems to have two arguments that I'd use to specify a
particular resolution in the output file, -tr and -ts.

How do I calculate the values I use for one, or the other, to get the
appropriate resolution for the zoom level I've chosen?



More information about the mapserver-users mailing list