#1088 closed defect (fixed)
GetMap Width/Height/Format are required parameters
Reported by: | assefa | Owned by: | tomkralidis |
---|---|---|---|
Priority: | high | Milestone: | 5.0 release |
Component: | WMS Server | Version: | 4.4 |
Severity: | normal | Keywords: | |
Cc: | nsavard@…, bartvde@…, tomkralidis, sdlime, jmckenna@… |
Description (last modified by )
There is no exception returned when the GetMap request is sent without the width, height or format.
Change History (36)
comment:2 by , 20 years ago
Cc: | added |
---|
AFAIK there are no test cases for this in the OGC CITE tests, which is quite weird.
comment:3 by , 20 years ago
Milestone: | → 4.6 release |
---|
Since that's not part of CITE (otherwise we would not pass the tests), and this doesn't prevent the software from working (it works with defaults), then I say we push this to 4.6. No need to take chances to break 4.4 for such a minor detail.
comment:4 by , 20 years ago
I checked the WMS OGC CITE tests and effectively, as Bart said, there is no test for that part of the specification.
comment:5 by , 18 years ago
Just a "bump" :) I'm on 4.6.1 and this is still the case ... Apparently the behavior changed in how projection is handled though. Specifying an SRS without a BBOX doesn't work the same now as it did in 3.6.6? (In 3.6.6 I guess the default extent was reprojected, so the expected map was returned anyways. Now an SRS without a BBOX just returns a blank map, presumably because the extent isn't reprojected?) I know, it's the client's fault for not making sure they use all mandatory parameters, but still, an error really should be raised! J.F.
comment:6 by , 17 years ago
Cc: | added |
---|
Any update on this one? The spec says they're required. CITE tests ignore them. Checking for them (and throwing exception) might cause problems for existing clients.
What do all think? My vote would be to check for the required parameters and throw exception if they are not present.
comment:7 by , 17 years ago
I agree with you Tom. Makes sense, and if this breaks something, people should fix their client anyway since if they change WMS vendor, they will have problems as well.
comment:8 by , 17 years ago
Cc: | added |
---|
Any other comments here? Not sure how we should proceed with a decision here (Daniel/Assefa?). If we do decide to check as per above, I can take this one.
comment:9 by , 17 years ago
Description: | modified (diff) |
---|---|
Owner: | changed from | to
I wasn hesitant but Bart convinced me with his last comment, so I'd say go ahead Tom unlees Assefa has objections. (And don't forget to update HISTORY.TXT and MIGRATION_GUIDE.TXT since this is a fix/change that may have impact on some users).
follow-up: 21 comment:11 by , 17 years ago
I've updated mapwms.c msWMSLoadGetMapParams (see r6549) with a last check to do the following:
- if any of srs, bbox, format, width, height are NOT found, throw exception
- if styles AND sld are NOT found, throw an exception
I suspect this might cause some heartache with some client requests w.r.t. STYLES. Many clients may not pass the STYLES parameter (you're supposed to, even "if STYLES=" is entered, that's valid).
HISTORY.TXT and MIGRATION_GUIDE.TXT updated.
If someone can do a quick once over, I can then close this one.
comment:13 by , 17 years ago
For the record, TileCache and OpenLayers are both already prepared for this change.
comment:14 by , 17 years ago
Thx. I've sent something to MapBuilder as well.
I think (hope?) this would be less of an issue with WMS client packages than with custom clients. The most common scenario I've seen where this will hurt will be where folks can quickly test a layer with:
http://wms.example.org/wms?service=WMS&version=1.1.1&request=GetMap&layers=foo
comment:15 by , 17 years ago
MapBuilder's current development code uses OpenLayers as the WMS client, so it will be covered as well.
follow-up: 18 comment:17 by , 17 years ago
As discussed (thanks hobu), this is because most of msautotest/wms_*.map tests are missing the now mandatory (to MapServer) parameters.
Normand: all GetMap and GetFeatureInfo requests in msautotest/wms_*.map will now require srs, bbox, format, width, height.
srs = we can use what's defined in the .map file bbox = can we use MAP/EXTENT from each .map file? format = can we use image/png as a default? width/height = we can use 400 x 300, as this is defined in all the .map files
I took a first look at updating them, but I'm not familiar enough with msautotest w.r.t. expected and real results (i.e. will the expected results now change? We also have to set these values to something representative of the mapfile and underlying data).
I've made a first change to msautotest/wxs/wms_time2.map. I now get back an image, but it doesn't match the expected.
Normand: any comments here?
Too bad, these were always defined as required parameters of OGC:WMS.
follow-up: 19 comment:18 by , 17 years ago
Replying to tomkralidis:
As discussed (thanks hobu), this is because most of msautotest/wms_*.map tests are missing the now mandatory (to MapServer) parameters.
Normand: all GetMap and GetFeatureInfo requests in msautotest/wms_*.map will now require srs, bbox, format, width, height.
srs = we can use what's defined in the .map file bbox = can we use MAP/EXTENT from each .map file? format = can we use image/png as a default? width/height = we can use 400 x 300, as this is defined in all the .map files
I took a first look at updating them, but I'm not familiar enough with msautotest w.r.t. expected and real results (i.e. will the expected results now change? We also have to set these values to something representative of the mapfile and underlying data).
I've made a first change to msautotest/wxs/wms_time2.map. I now get back an image, but it doesn't match the expected.
Normand: any comments here?
Too bad, these were always defined as required parameters of OGC:WMS.
Tom,
I'll go through the tests and fix the issue. I'll let you know when I'm done.
comment:19 by , 17 years ago
Replying to nsavard:
Replying to tomkralidis:
As discussed (thanks hobu), this is because most of msautotest/wms_*.map tests are missing the now mandatory (to MapServer) parameters.
Normand: all GetMap and GetFeatureInfo requests in msautotest/wms_*.map will now require srs, bbox, format, width, height.
srs = we can use what's defined in the .map file bbox = can we use MAP/EXTENT from each .map file? format = can we use image/png as a default? width/height = we can use 400 x 300, as this is defined in all the .map files
I took a first look at updating them, but I'm not familiar enough with msautotest w.r.t. expected and real results (i.e. will the expected results now change? We also have to set these values to something representative of the mapfile and underlying data).
I've made a first change to msautotest/wxs/wms_time2.map. I now get back an image, but it doesn't match the expected.
Normand: any comments here?
Too bad, these were always defined as required parameters of OGC:WMS.
Tom,
I'll go through the tests and fix the issue. I'll let you know when I'm done.
Thx. Let me know how I can help/test. Note that I've since made some commits to msautotest. I'll stop now and wait on your updates/comments.
comment:20 by , 17 years ago
Should this also be documented somewhere on the website (FAQ)? Also, section 2.3.2 of the WMS-Server howto has to be modified to reflect this change (maybe eliminate 2.3.2.1?).
follow-up: 22 comment:21 by , 17 years ago
Replying to tomkralidis:
If someone can do a quick once over, I can then close this one.
The changes look good. Can we close this now or are we waiting for the tests to be updated?
follow-ups: 23 26 comment:22 by , 17 years ago
Cc: | added |
---|
Replying to dmorissette:
Replying to tomkralidis:
If someone can do a quick once over, I can then close this one.
The changes look good. Can we close this now or are we waiting for the tests to be updated?
I've made changes to the WMS-Server howto (http://mapserver.gis.umn.edu/docs/howto/wms_server/#test-with-a-getmap-request), and added this to the OGC section of the FAQ (http://mapserver.gis.umn.edu/docs/faq/ogc-wms-getmap-required-parameters)
I'd like to make sure msautotest is updated (waiting for news from Normand).
comment:23 by , 17 years ago
follow-up: 25 comment:24 by , 17 years ago
Hi Tom
It would be interesting to add some comment about this in the WMS-Client howto too. Now, to use a MapServer WMS Sever the MapServer WMS clients must include the wms_style parameter or some SLD parameter (wms_sld_ur or wms_sld_body, which, by the way, are not cited in the WMS-Client howto). (With raster layers I did not usually include any of them).
Thanks, Jorge
comment:25 by , 17 years ago
Hi Jorge,
Good point. See #2242 for the fix to WMS Client. The docs don't need updating however. If the client doesn't set wms_style, etc. then "STYLES=" is sent.
comment:26 by , 17 years ago
I'd like to make sure msautotest is updated (waiting for news from Normand).
Tom, I updated the msautotest related to this problem.
comment:27 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Thanks Norm! So the msautotest/wxs which were affected by this ticket have been updated, as well a change to mapwmslayer.c (see #2242).
Closing. Thanks everyone!
follow-up: 29 comment:28 by , 17 years ago
A question about GetFeatureInfo... My uninformed reading of the WMS 1.1.1 spec says that these items are not required for GetFeatureInfo, and in fact do not make sense to have them required in this instance? Same for GetLegendGraphic, et. al?
comment:29 by , 17 years ago
Replying to hobu:
A question about GetFeatureInfo... My uninformed reading of the WMS 1.1.1 spec says that these items are not required for GetFeatureInfo, and in fact do not make sense to have them required in this instance? Same for GetLegendGraphic, et. al?
See section 7.3.3.4 of the spec (OGC:WMS 1.1.1: http://portal.opengeospatial.org/files/?artifact_id=1081&version=1&format=pdf), which, to me, suggests that that a copy of the GetMap request (without VERSION and REQUEST, which GetFeatureInfo passes already) shall be embedded as part of GetFeatureInfo.
GetLegendGraphic, DescribeLayer, and GetCapabilities have their own parameters specifics, which this ticket does not apply to.
comment:30 by , 17 years ago
P.S., I forgot to mention GetStyles as an operation which has its own parameter specifics.
comment:31 by , 17 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
http://mapserver.gis.umn.edu/development/release_plans/mapserver_5_0/migration_guide_410_50/
"OGC Web Map Service (WMS)" does not mention the fact that 'request' is also a neccesary parameter, which is neccesary for cases like mapscript.OWSRequest , which in the past would default to GetMap, but will now segfault if it's not available.
Addressing the segfault is #2299, but including some mention of this in the migration guide is neccesary as well
comment:32 by , 17 years ago
I'm not quite sure I follow you. FYI this ticket never touched the request parameter, which has always been required.
If I invoke (against latest svn trunk r6870):
I get an exception asking for the request parameter. If I include the request parameter, I get a valid response of a map image as expected.
So, in the context of this ticket, there is no change in behaviour of handling the request parameter from the WMS server point of view.
crschmidt: does this make sense?
comment:33 by , 17 years ago
tomkralidis: I'm talking about mapscript.OWSRequest, which in the past would generate a map without the REQUEST parameter, but now doesn't do so. If this is the wrong place for it, then it still needs to be mentioned in the migration guide (unless, as I think you're saying, mapscript.OWSRequest was throwing an exception for that in 4.10, which I can confirm was *not* the case in any of my setups.)
comment:34 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
comment:36 by , 17 years ago
Should be okay. Some changes per comment:22, and there's nothing in the WMS Client howto that would need a change.