[mapserver-dev] Fwd: mapresample algorithm

fred p mapoubelle22 at gmail.com
Thu Nov 3 11:28:42 EDT 2011


Hello,
Nobody has replied to the following message. I would be grateful if
somebody could take some minutes to express his feeling about the behavior
I described that seems strange to me.
Thanks.

---------- Message transféré ----------
De : fred p <mapoubelle22 at gmail.com>
Date : 12 octobre 2011 13:47
Objet : mapresample algorithm
À : mapserver-dev at lists.osgeo.org


Hello,

I want to serve a source image via a WMS through mapserver but I sometimes
get a very low resolution due to the algorithm applied in the
msResampleGDALToMap method in mapresample.c. This occurs when I request a
much larger area  and a much lower resolution than the ones of the source
image.

For example, here is an extract of the gdalinfo :

Size is 8192, 6144
Coordinate System is:
PROJCS["unnamed",
    GEOGCS["unnamed ellipse",
        DATUM["unknown",
            SPHEROID["unnamed",6378160,298.2539162964669]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433]],
    PROJECTION["Polar_Stereographic"],
    PARAMETER["latitude_of_origin",60],
    PARAMETER["central_meridian",0],
    PARAMETER["scale_factor",1],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]]]
Origin = (-4937982.331945824436843,-1228156.832371974131092)
Pixel Size = (1093.000000000000000,-1093.000000000000000)
Corner Coordinates:
Upper Left  (-4937982.332,-1228156.832) ( 76d 1'58.80"W, 43d45'32.40"N)
Lower Left  (-4937982.332,-7943548.832) ( 31d51'59.40"W, 13d34'43.86"N)
Upper Right ( 4015873.668,-1228156.832) ( 72d59'42.10"E, 51d11'57.65"N)
Lower Right ( 4015873.668,-7943548.832) ( 26d49'8.23"E, 16d20'22.12"N)

Here is an extract of the WMS request :

&width=885&height=443&bbox=-177,-88.6,177,88.6&

The algorithm transforms the requested bbox in the SRS of the origin image
and calculates the size in the source image (sOrigSrcExtent) of this bbox
before evaluating sDummyMap.cellsize from sOrigSrcExtent. As a result I get
a very low nLoadImgXSize an nLoadImgYSize (respectivly 8 and 6 !). Wouldn't
it be possible to improve this algorithm by calculating sDummyMap.cellsize
from the extent of the origin image instead of from the extent of the
transformed requested bbox ?

For now I have identified 2 alternatives (maybe there are others ?) that
are not really convenient :
1 - calculate while handling any request an adequate oversample_ratio
(doesn't simplify the code of my mapscript ;))
2 - use the processing option "load_whole_image" but the response time is
affected.

Thanks in advance for your response / help.

 <http://int.ask.com/web?siteid=10000861&webqsrc=999&l=dis&q=mapresample>

 <http://int.ask.com/web?siteid=10000861&webqsrc=999&l=dis&q=feedback>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20111103/e980bc64/attachment.html


More information about the mapserver-dev mailing list