TIF vs JPG - Performance

Frank Warmerdam warmerdam at POBOX.COM
Tue Sep 19 16:45:49 EDT 2006


Léveillé wrote:
> Hi,
>  
> I've been using MapServer for a while (Oracle 10g, MapInfo, Shape Files, 
> etc.) - everything works great !
>  
> For the first time, we want to use raster data - over 6000 orthophotos.
> All the orthophotos are available both in TIF and JPG.
> Every orthophoto if about 80 Mb in TIF (includes multi-res) and about 
> 4Mb in JPG.
>  
> 2 Questions :
>  
> - Is there a concept of multi-res in the JPG format (as in TIFF) ?

James,

The JPEG format does not include any multi-resolution support.  Well,
at least not in any form useful from GDAL or mapserver.  But GDAL
(and thus mapserver) does support an external .ovr file for overviews.
This will just be a TIFF file.  It can be generated with gdaladdo.

> - Which format should I use to acquire the best performance from 
> MapServer ???

Generally speaking pulling an overview out of raw JPEG, or pulling out
a small subwindow not near the top of the file is very expensive.  So
for more dependable performance I'd suggest TIFF format. If space is an
option consider producing tiled TIFFs with jpeg compression internally.

Something like the following may work for you:

    gdal_translate public_html/world.tif jpeg_world.tif
       -co COMPRESS=JPEG -co TILED=YES -co JPEG_QUALITY=20
    gdaladdo jpeg_world.tif 4 8 16 32

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 mapserver-users mailing list