Skip to content
Permalink
Browse files

msResampleGDALToMap(): fix inappropriate cellsize computation when lo…

…ading (well beyond) full source raster.
  • Loading branch information
rouault committed Jan 17, 2017
1 parent ba9e11a commit e0a3448f3f42d20a0d271709c8629a5b40d13951
@@ -1471,7 +1471,12 @@ int msResampleGDALToMap( mapObj *map, layerObj *layer, imageObj *image,
sqrt(adfSrcGeoTransform[1] * adfSrcGeoTransform[1]
+ adfSrcGeoTransform[2] * adfSrcGeoTransform[2]);

if( (sOrigSrcExtent.maxx - sOrigSrcExtent.minx) > dfOversampleRatio * nDstXSize
/* Check first that the requested extent is not greater than the source */
/* raster. This might be the case for example if asking to visualize */
/* -180,-89,180,90 in EPSG:4326 from a raster in Arctic Polar Stereographic */
if( !(sOrigSrcExtent.minx <= -nSrcXSize && sOrigSrcExtent.miny <= -nSrcYSize &&
sOrigSrcExtent.maxx >= 2 * nSrcXSize && sOrigSrcExtent.maxy >= 2 * nSrcYSize)
&& (sOrigSrcExtent.maxx - sOrigSrcExtent.minx) > dfOversampleRatio * nDstXSize
&& !CSLFetchBoolean( layer->processing, "LOAD_FULL_RES_IMAGE", FALSE ))
sDummyMap.cellsize =
(dfNominalCellSize * (sOrigSrcExtent.maxx - sOrigSrcExtent.minx))
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,48 @@
#
# Tests support for images in polar stereographic projection
#
# REQUIRES: SUPPORTS=WMS
#
#
# GetMap
# RUN_PARMS: wms_polar_stereo.png [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&LAYERS=test&STYLES=&CRS=EPSG:4326&BBOX=-89,-180,90,180&WIDTH=200&HEIGHT=200&FORMAT=image/png" > [RESULT_DEMIME]

MAP

NAME TEST
STATUS ON
SIZE 200 200
EXTENT -180 -89 180 90
IMAGECOLOR 0 0 0

PROJECTION
"init=epsg:4326"
END

IMAGETYPE png8_t

OUTPUTFORMAT
NAME png8_t
DRIVER "GD/PNG"
IMAGEMODE PC256
TRANSPARENT OFF
END

WEB
METADATA
"ows_enable_request" "*"
"wms_srs" "EPSG:4326"
END
END

LAYER
NAME test
TYPE raster
STATUS default
DATA data/polar_stereo.tif
PROJECTION
AUTO
END
END
END # of map file

0 comments on commit e0a3448

Please sign in to comment.
You can’t perform that action at this time.