[Gdal-dev] gdal/mapserver debug output, What does it mean?

Frank Warmerdam warmerdam at pobox.com
Tue Mar 27 21:41:22 EDT 2007

Stephen Woodbridge wrote:
> Hi Frank,
> I am looking into tuning GDAL/mapserver for a bunch of raster data and I 
> remember you saying that you output additional GDAL info when DEBUG is 
> on. What does it mean? and is it helpful in tuning mapserver or 
> determining what overviews I need to generate.
> [Tue Mar 27 23:31:37 2007] [error] [client] [Tue Mar 27 
> 23:31:37 2007].930822 msDrawRasterLayerLow(test): entering., referer: 
> http://localhost/sw/
> [Tue Mar 27 23:31:37 2007] [error] [client] [Tue Mar 27 
> 23:31:37 2007].999147 msDrawGDAL(): src=3980,3648,232,185, 
> dst=0,0,500,400, referer: http://localhost/sw/
> [Tue Mar 27 23:31:37 2007] [error] [client] [Tue Mar 27 
> 23:31:37 2007].999196 msDrawGDAL(): red,green,blue,alpha bands = 
> 1,2,3,0, referer: http://localhost/sw/
> [Tue Mar 27 23:31:38 2007] [error] [client] [Tue Mar 27 
> 23:31:38 2007].122412 msDrawMap(): Layer 0 (test), 0.192s, referer: 
> http://localhost/sw/


The src= is the pixel window being read from the file on disk, and
the dst= is the pixel window in the map buffer.  So in the above
example src=3980,3648,232,185, dst=0,0,500,400 means that a small
window out of the source file is being replicated a bit and apparently
covers the whole destination bitmap (assuming that is 500x400).

> I assume the interesting part is the src= and dst= is there other output 
> that I should be looking at? how would I turn that on?

You should watch for an msResample message, which I see you don't get.
If you see that, it means the general resampling engine is being used
(the same as is used for reprojection) and performance will be degraded.

> As I zoom out I get lots of records like the above. I assume one for 
> every tif file that gets opened. I currently do not have any overviews 
> built into the image files. I am also wondering at what point does it 
> make sense to create an external overview and if there are any scripts 
> that would generate these.

If the src window is much larger than the destination window, then you
are in a situation where in-file overviews would be helpful. If you see
many of the src=/dst= lines for a single map request, then you know lots
of files on disk are getting touched.

My general rule of thumb is that at the scale where a single map requests
touches more than 16 tiff files, you should likely be trying to build a
new overview layer in your map file.

I don't have any handy scripts for generating such things, but you can use
Mapserver itself.

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