Ticket #1088 (closed defect: fixed)

Opened 5 years ago

Last modified 2 years ago

GetMap Width/Height/Format are required parameters

Reported by: assefa Assigned to: tomkralidis
Priority: high Milestone: 5.0 release
Component: WMS Server Version: 4.4
Severity: normal Keywords:
Cc: nsavard@mapgears.com, bartvde@osgis.nl, tomkralidis, sdlime, jmckenna@dmsolutions.ca

Description (Last modified by dmorissette)

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

Change History

11/24/04 10:48:43 changed by assefa

  • cc set to nsavard@dmsolutions.ca.
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.

11/24/04 10:55:41 changed by bartvde@osgis.nl

  • cc set to bartvde@xs4all.nl.
AFAIK there are no test cases for this in the OGC CITE tests, which is quite weird.

11/24/04 12:02:21 changed by dmorissette

  • milestone set to 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.

11/24/04 12:17:49 changed by nsavard@mapgears.com

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

01/23/06 15:23:42 changed by jdoyon@nrcan.gc.ca

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.

08/09/07 11:28:16 changed by tomkralidis

  • cc changed from nsavard@mapgears.com, bartvde@osgis.nl to nsavard@mapgears.com, bartvde@osgis.nl, tomkralidis.

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.

08/09/07 11:46:27 changed 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.

08/09/07 12:47:59 changed by tomkralidis

  • cc changed from nsavard@mapgears.com, bartvde@osgis.nl, tomkralidis to nsavard@mapgears.com, bartvde@osgis.nl, tomkralidis, sdlime.

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.

08/09/07 12:55:49 changed by dmorissette

  • owner changed from mapserverbugs to tomkralidis.
  • description changed.

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

08/09/07 14:56:55 changed by assefa

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

(follow-up: ↓ 21 ) 08/10/07 08:14:33 changed 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.

08/10/07 15:18:50 changed by hobu

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

08/10/07 20:59:11 changed by crschmidt

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

08/11/07 11:01:24 changed 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

08/11/07 11:09:58 changed by crschmidt

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

08/13/07 15:48:12 changed by hobu

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

(follow-up: ↓ 18 ) 08/13/07 16:30:26 changed 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.

(in reply to: ↑ 17 ; follow-up: ↓ 19 ) 08/13/07 16:47:24 changed 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.

(in reply to: ↑ 18 ) 08/13/07 16:53:48 changed 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.

08/14/07 08:23:22 changed 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?).

(in reply to: ↑ 11 ; follow-up: ↓ 22 ) 08/14/07 16:31:42 changed 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?

(in reply to: ↑ 21 ; follow-ups: ↓ 23 ↓ 26 ) 08/14/07 17:34:03 changed by tomkralidis

  • cc changed from nsavard@mapgears.com, bartvde@osgis.nl, tomkralidis, sdlime to nsavard@mapgears.com, bartvde@osgis.nl, tomkralidis, sdlime, jmckenna@dmsolutions.ca.

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

(in reply to: ↑ 22 ) 08/16/07 13:52:47 changed by tomkralidis

(follow-up: ↓ 25 ) 08/17/07 09:55:21 changed 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

(in reply to: ↑ 24 ) 08/17/07 11:51:03 changed 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.

(in reply to: ↑ 22 ) 08/17/07 16:06:31 changed 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.

08/17/07 17:12:34 changed by tomkralidis

  • status changed from new to closed.
  • resolution set to fixed.

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 ) 08/20/07 00:14:49 changed 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?

(in reply to: ↑ 28 ) 08/20/07 00:43:44 changed 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.

08/20/07 00:44:36 changed by tomkralidis

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

09/09/07 11:55:58 changed by crschmidt

  • status changed from closed to reopened.
  • resolution deleted.

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

09/10/07 07:53:57 changed 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?

09/10/07 10:38:01 changed 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.)

09/10/07 11:21:11 changed by tomkralidis

  • status changed from reopened to closed.
  • resolution set to fixed.

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.

09/11/07 16:42:46 changed by jmckenna

are there any documentation issues for this ticket?

09/12/07 07:10:22 changed by tomkralidis

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