[mapserver-users] Re: Image shrinking problem
Juozas Urbonas
juozas.urbonas at teltonika.lt
Fri Mar 14 08:24:39 PDT 2008
Hello again,
I achieve best image quality with my driver when using PROCESSING
"OVERSAMPLE_RATIO=1", but there seems to be a bug in the MapServer, because
sometimes I get images, which have last row and sometimes last column set to
map's back color. If I set OVERSAMPLE_RATIO to 1.01 the problem seems to
disappear, but image quality degrades noticeably, because I'm using
PROCESSING "RESAMPLE=NEAREST" to achieve lowest image size when using PNG
compression. When using RESAMPLE set to BILINEAR or AVERAGE, PNG image size
triples. I want to use PNG, because my map is road map with lots of areas in
same color.
If I'm correct, hope this bug can be fixed by someone.
Thanks.
Juozas.
----- Original Message -----
From: "Frank Warmerdam" <warmerdam at pobox.com>
To: "Juozas Urbonas" <juozas.urbonas at teltonika.lt>
Cc: <mapserver-users at lists.osgeo.org>
Sent: Wednesday, February 27, 2008 11:27 PM
Subject: Re: [mapserver-users] Re: Image shrinking problem
> 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