Overview Images in Mapserver
Frank Warmerdam
fwarmerdam at GMAIL.COM
Fri Jul 8 10:24:43 PDT 2005
On 7/8/05, Kenneth Denson <frogbot at gmail.com> wrote:
> I have 9 24-bit geotiffs that I've indexed using gdaltindex. They display
> just perfectly in mapserver, but the problem is that it can be a little
> slow. I've used gdaladdo to add some overview levels to the geotiffs, but
> how do I tell mapserver to use those overviews? Or is it doing it
> automatically? Just for reference, the following is the information about
> the geotiffs and how their layer looks in mapserver.
>
> Size is 10000, 10000
> Coordinate System is `'
> Origin = (2360000.000000,850000.000000)
> Pixel Size = (0.500000,-0.500000)
> Metadata:
> TIFFTAG_SOFTWARE=Adobe Photoshop 7.0
> TIFFTAG_DATETIME=2003:11:17 17:34:02
> Corner Coordinates:
> Upper Left ( 2360000.000, 850000.000)
> Lower Left ( 2360000.000, 845000.000)
> Upper Right ( 2365000.000, 850000.000)
> Lower Right ( 2365000.000, 845000.000)
> Center ( 2362500.000, 847500.000)
> Band 1 Block=10000x1 Type=Byte, ColorInterp=Red
> Overviews: 3x3, 3x3, 3x3, 3x3, 3x3, 3x3, 3x3, 3x3, 5000x5000, 2500x2500,
> 1667x1667, 1250x1250, 1000x1000
> Band 2 Block=10000x1 Type=Byte, ColorInterp=Green
> Overviews: 3x3, 3x3, 3x3, 3x3, 3x3, 3x3, 3x3, 3x3, 5000x5000, 2500x2500,
> 1667x1667, 1250x1250, 1000x1000
> Band 3 Block=10000x1 Type=Byte, ColorInterp=Blue
> Overviews: 3x3, 3x3, 3x3, 3x3, 3x3, 3x3, 3x3, 3x3, 5000x5000, 2500x2500,
> 1667x1667, 1250x1250, 1000x1000
Ken,
Ed already answer most issues, but I just wanted to mention a couple
of things.
1) You have a whole series of 3x3 overviews which is pretty strange.
What gdaladdo commandline did you use? I would suggest something
like:
gdaladdo your.tif 2 4 8 16 32 64
The "64" level will produce overviews that are 157 x 157 for your
10K x 10K files. There isn't much point in going beyond this. There
is a bit of cost to having extra overviews as GDAL needs to parse the
TIFFF directory for each overview.
2) At rull resolution you will get better render performance if the data
file is internally tiled. Currently a 400x400 full res view will
require reading
through 400 scanlines of data or 400x10000 pixels of data. If your TIFF was
internally tiled, it would likely be more like 4-9 256x256 tiles being accessed.
substantially cutting down the amount of data that needs to be accessed
from disk.
You can rewrite a scanline oriented file to tiled like this:
gdal_translate -co TILED=YES original.tif tiled.tif
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 | Geospatial Programmer for Rent
More information about the MapServer-users
mailing list