[mapserver-users] Re: Image shrinking problem

Frank Warmerdam warmerdam at pobox.com
Wed Feb 27 16:27:53 EST 2008


Juozas Urbonas wrote:
> I'm sorry, I forgot to mention, that I'm creating GDAL driver, which I'm 
> trying to use with MapServer.
>  
> Here is the gdalinfo for my map:
> Driver: AkisAx/Akis Map Link (.mln)

...
>     Hi All,
>      
>     When I'm requesting some image using WMS, my overridden IRasterIO
>     gets called with nBufXSize and nBufYSize nearly double the size I'm
>     requesting in WMS call and in the process image returned by WMS gets
>     shrinked. What may cause this problem?
>     I'm expecting nBufXSize and nBufYSize to be approximately the same
>     size as in WMS request.

Juozas,

I seem to have missed this question the first time around.  If you request
the image by WMS in it's native coordinate system then MapServer should do
a RasterIO() request to the GDAL driver suitable for direct application to
the WMS image buffer.  That is the buffer xsize/ysize will be no larger than
the requested image.

But if you request in another coordinate system, or if MapServer decides to
go through the "general resampler" (ie. mapresample.c) for any other
reason (such as non-square pixel request, rotated image, RESAMPLE=<something
other than NEAREST>) then things are different.  In this case mapresample.c
will request the image for the region of interest at approximately double
the final request resolution and then sample from that buffer.

You can control this "oversampling ratio" using the OVERSAMPLE_RATIO
PROCESSING directive.

eg.
PROCESSING "OVERSAMPLE_RATIO=1.1"

Note that I pull at double resolution in the hopes of avoiding some aliases
issues with fetching the data at nearly the target resolution before going
through the resampler.  So you may see image quality degrade if you pick a
modest oversample ratio.

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