Mapserver WMS client reprojects latlonboundingbox
Bart van den Eijnden
bartvde at XS4ALL.NL
Fri Mar 25 08:46:51 EST 2005
Hi list,
today we ran into a strange problem with Mapserver WMS client, when
zooming into a Demis WMS layer, Mapserver WMS client did not want to
render a layer, it did not even try to request the layer. Our application
operates in EPSG:28992 (Netherlands).
This is the important part of the WMS capabilities:
<LatLonBoundingBox minx="-180" miny="-90" maxx="180" maxy="90"/>
<BoundingBox SRS="EPSG:28992" minx="48443.3472125024"
miny="404023.309341862" maxx="144763.347212502" maxy="484658.309341862"/>
After a little digging in the code, I found something strange in
mapwmslayer.c:
// Reproject latlonboundingbox to the selected SRS for the layer and
// check if it overlaps the bbox that we calculated for the request
msProjectRect(&(map->latlon), &(lp->projection), &ext);
So what it is gonna do, is reproject -180,-90,180,90 into the Dutch RD
system, which is not valid outside of Netherlands :)
This is strange since it could easily use the other BoundingBox (for
EPSG:28992) specified in the WMS capabilities. It should only try to
reproject if a WMS service would not provide the "native" boundingbox in
my opinion.
But ofcourse one can argue that the Demis WMS service did not provide
correct/precise values for the LatLonBoundingBox ....
I have filed bug 1295 though about this:
http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=1295
Best regards,
Bart
PS This is the MAP file definition used:
LAYER
CONNECTION "http://myserver/wms/wms.asp?wms=TOPOFOTO&"
CONNECTIONTYPE WMS
DEBUG ON
DUMP TRUE
METADATA
"wms_srs" "EPSG:28992"
#"wms_latlonboundingbox" "-180 -90 180 90"
"wms_name" "Luchtfoto"
"wms_formatlist" "image/png,image/jpeg,image/gif,image/bmp,image/swf"
"wms_format" "image/png"
"wms_boundingbox" "EPSG:28992 48443.34766 404023.3125 144763.34375
484658.3125"
"wms_server_version" "1.1.1"
"wms_title" "Luchtfoto"
END
NAME "demis-Luchtfoto"
PROJECTION
"init=epsg:28992"
END
SIZEUNITS PIXELS
STATUS ON
TEMPLATE "blank.html"
TOLERANCE 0
TOLERANCEUNITS PIXELS
TYPE RASTER
UNITS METERS
END
More information about the mapserver-dev
mailing list