Opened 16 years ago

Closed 13 years ago

Last modified 13 years ago

#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 dmorissette)

There is no exception returned when the GetMap request is sent without the 
width, height or format.

Change History (36)

comment:1 Changed 16 years ago by assefa

Cc: nsavard@… added
Norm,

Are there any validations done on required parameters in the wms compliance test
suite ? I have briefly checked and could not find one.

Required parameters that are not tested here are WIDTH, HEIGHT, SRS, BBOX,
Format, STYLES (required if there is no SLD).

It is weird that no one realized this. Sending exception when these parameters
are missing will probably cause some problems for some.

comment:2 Changed 16 years ago by bartvde@…

Cc: bartvde@… added
AFAIK there are no test cases for this in the OGC CITE tests, which is quite weird.

comment:3 Changed 16 years ago by dmorissette

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 Changed 16 years ago by nsavard@…

I checked the WMS OGC CITE tests and effectively, as Bart said, there is no test
for that part of the specification.

comment:5 Changed 14 years ago by jdoyon@…

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 Changed 13 years ago by tomkralidis

Cc: tomkralidis 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 Changed 13 years ago by bartvde

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 Changed 13 years ago by tomkralidis

Cc: sdlime 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 Changed 13 years ago by dmorissette

Description: modified (diff)
Owner: changed from mapserverbugs to tomkralidis

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).

comment:10 Changed 13 years ago by assefa

Tom : I have no objections to the changes you want to do.

comment:11 Changed 13 years ago by tomkralidis

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:12 Changed 13 years ago by hobu

ouch. This is going to cause some serious pain, IMO.

comment:13 Changed 13 years ago by crschmidt

For the record, TileCache? and OpenLayers? are both already prepared for this change.

comment:14 Changed 13 years ago by tomkralidis

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 Changed 13 years ago by crschmidt

MapBuilder?'s current development code uses OpenLayers? as the WMS client, so it will be covered as well.

comment:16 Changed 13 years ago by hobu

Most of the msautotest/wxs tests are now failing...

comment:17 Changed 13 years ago by 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.

comment:18 in reply to:  17 ; Changed 13 years ago by 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.

comment:19 in reply to:  18 Changed 13 years ago by tomkralidis

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 Changed 13 years ago by tomkralidis

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?).

comment:21 in reply to:  11 ; Changed 13 years ago by 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?

comment:22 in reply to:  21 ; Changed 13 years ago by tomkralidis

Cc: jmckenna@… 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:24 Changed 13 years ago by jparapar

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 in reply to:  24 Changed 13 years ago by tomkralidis

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 in reply to:  22 Changed 13 years ago by nsavard

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 Changed 13 years ago by tomkralidis

Resolution: fixed
Status: newclosed

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!

comment:28 Changed 13 years ago by 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?

comment:29 in reply to:  28 Changed 13 years ago by tomkralidis

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 Changed 13 years ago by tomkralidis

P.S., I forgot to mention GetStyles as an operation which has its own parameter specifics.

comment:31 Changed 13 years ago by crschmidt

Resolution: fixed
Status: closedreopened

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 Changed 13 years ago by tomkralidis

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):

http://devgeo.cciw.ca/cgi-bin/mapserv/ecows?service=WMS&version=1.1.1&layers=obs&bbox=-150,40,-50,80&format=image/png&styles=&srs=EPSG:4326&width=500&height=300&

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 Changed 13 years ago by crschmidt

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 Changed 13 years ago by tomkralidis

Resolution: fixed
Status: reopenedclosed

Daniel's fix in r6873 fixes the #2299.

I guess my main concern is that MapServer WMS never worked without a client issuing the REQUEST parameter.

Closing this one so that discussion can continue in #2299.

comment:35 Changed 13 years ago by jmckenna

are there any documentation issues for this ticket?

comment:36 Changed 13 years ago by tomkralidis

Should be okay. Some changes per comment:22, and there's nothing in the WMS Client howto that would need a change.

Note: See TracTickets for help on using tickets.