[mapserver-users] MapServer Fails

Frank Warmerdam warmerdam at pobox.com
Fri Jun 10 09:16:04 EDT 2011


On 11-06-10 04:26 AM, SixDegrees wrote:
> We have several NITF images that can be successfully translated to, say, PNG
> or GTiff format using a gdal_translate command similar to the following:
>
>     gdal_translate -ot Byte -of GTiff -scale -b 3 -b 2 -b 1myNitf.ntf
> ~/myGTif.tif
>
> However, we are having trouble getting MapServer to serve these images. We
> get what looks like a single pixel, greatly enlarged to fill the entire
> returned image file, showing one or two colors from the input image. We have
> adjusted the BBox to encompass larger areas with no success. MapServer is
> configured at DEBUG level 5, both CPL_DEBUG and PROJ_DEBUG are enabled, but
> no error messages occur during processing; the same is true when running
> mapserv on the command line, feeding it the query string from the browser
> request - no errors, and an image consisting of a block of one or two solid
> colors is returned.
>
> Any thoughts on A) how to configure the mapfile, B) how to further
> investigate what is going on? It might be useful to be able to see the
> underlying GDAL calls being made, for instance, or the various parameters -
> in particular, the bounding box being passed - or C) any other guidance on
> how to proceed in debugging this problem?

Paul,

If you capture all the MapServer debug output you should be alle to see
the window accessed and the scaling used.

eg.

[Fri Jun 10 09:14:27 2011].271521 msDrawRasterLayerLow(grid1): entering.
GDAL: GDALOpen(/home/warmerda/mapserver/msautotest/gdal/./data/float.tif, 
this=0x1146570) succeeds as GTiff.
[Fri Jun 10 09:14:27 2011].287958 msDrawRasterLayerGDAL(): Entering transform.
[Fri Jun 10 09:14:27 2011].288045 msDrawRasterLayerGDAL(): src=0,0,40,30, 
dst=0,0,400,300
[Fri Jun 10 09:14:27 2011].288071 msDrawRasterLayerGDAL(): source raster PL 
(0.000,-0.000) for dst PL (0,0).
[Fri Jun 10 09:14:27 2011].288114 msDrawRasterLayerGDAL(): red,green,blue,alpha 
bands = 1,0,0,0
[Fri Jun 10 09:14:27 2011].309383 msDrawRasterGDAL_16BitClassification(grid1):
   scaling to 4 buckets from range=-10.5,10.5.

You didn't provide any information on how you configured the layer in
mapserver.  I am wondering if you used PROCESSING "SCALE=AUTO" or not?  That
would be the rough analog of the -scale option used for gdal_translate.

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