Mapping Hacks

by Schuyler Erle, Rich Gibson and Jo Walsh

« Blender + GDAL + Python = 3-D Terrain Models…? Free Geodata Torrents Available »

Mini-HOWTO: Prepping Large Rasters for Use in MapServer

February 24th, 2005 by Schuyler

In yet another informative post to the MapServer users mailing list
(login required), Frank Warmerdam explains how to use the tiling and overview
features of GDAL’s GeoTIFF driver to get
optimal performance on large raster images in MapServer, QGIS, OpenEV, etc.:

Assuming your GeoTIFF input is in.tif, you would do something
like:

$ gdalwarp in.tif latlong.tif -t_srs WGS84 -co TILED=YES
$ gdaladdo latlong.tif 2 4 8 16 32 64 128 256

The warp reprojects to lat/long (WGS84) and the output file is
created tiled. The gdaladdo call adds overviews. You might want
to skip the level 2 overview if you are wanting to avoid using too
much disk space. Keep in mind that TIFF files cannot be larger
than 4GB.

Tiling the GeoTIFF allows apps to fetch rectangular sub-areas of the raster
more efficiently. Similarly, adding overviews (basically embedded thumbnails)
allows apps to retrieve less data from the file at larger scales, at the
expense of disk space (because all the overviews have to be stored in the
GeoTIFF alongside the original data). Most commercial web mapping apps use one
or both of these techniques to improve server response time. Note that the
reprojection is unnecessary if the GeoTIFF is already in the right projection
for your application.

Posted in software |

You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.


Leave a Reply

You must be logged in to post a comment.


Entries (RSS) and Comments (RSS).