GetMap Width/Height/Format are required parameters #1088

Closed
mapserver-bot opened this Issue Apr 3, 2012 · 36 comments

Projects

None yet

2 participants

@mapserver-bot

Reporter: assefa
Date: 2004/11/24 - 16:17
Trac URL: http://trac.osgeo.org/mapserver/ticket/1088

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

Author: assefa
Date: 2004/11/24 - 16:48

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.
@mapserver-bot

Author: bartvde@osgis.nl
Date: 2004/11/24 - 16:55

AFAIK there are no test cases for this in the OGC CITE tests, which is quite weird.
@mapserver-bot

Author: dmorissette
Date: 2004/11/24 - 18:02

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.
@mapserver-bot

Author: nsavard@mapgears.com
Date: 2004/11/24 - 18:17

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

Author: jdoyon@nrcan.gc.ca
Date: 2006/01/23 - 21:23

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.
@mapserver-bot

Author: tomkralidis
Date: 2007/08/09 - 17:28
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.

@mapserver-bot

Author: bartvde
Date: 2007/08/09 - 17:46
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.

@mapserver-bot

Author: tomkralidis
Date: 2007/08/09 - 18:47
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.

@mapserver-bot

Author: dmorissette
Date: 2007/08/09 - 18:55
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).

@mapserver-bot

Author: assefa
Date: 2007/08/09 - 20:56
Tom : I have no objections to the changes you want to do.

@mapserver-bot

Author: tomkralidis
Date: 2007/08/10 - 14:14
I've updated mapwms.c msWMSLoadGetMapParams (see d85635f (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.

@mapserver-bot

Author: hobu
Date: 2007/08/10 - 21:18
ouch. This is going to cause some serious pain, IMO.

@mapserver-bot

Author: crschmidt
Date: 2007/08/11 - 02:59
For the record, TileCache and OpenLayers are both already prepared for this change.

@mapserver-bot

Author: tomkralidis
Date: 2007/08/11 - 17:01

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
@mapserver-bot

Author: crschmidt
Date: 2007/08/11 - 17:09
MapBuilder's current development code uses OpenLayers as the WMS client, so it will be covered as well.

@mapserver-bot

Author: hobu
Date: 2007/08/13 - 21:48
Most of the msautotest/wxs tests are now failing...

@mapserver-bot

Author: tomkralidis
Date: 2007/08/13 - 22:30
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.

@mapserver-bot

Author: nsavard
Date: 2007/08/13 - 22:47
Replying to [comment:17 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.

@mapserver-bot

Author: tomkralidis
Date: 2007/08/13 - 22:53
Replying to [comment:18 nsavard]:

Replying to [comment:17 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.

@mapserver-bot

Author: tomkralidis
Date: 2007/08/14 - 14:23

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

@mapserver-bot

Author: dmorissette
Date: 2007/08/14 - 22:31
Replying to [comment:11 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?

@mapserver-bot

Author: tomkralidis
Date: 2007/08/14 - 23:34
Replying to [comment:21 dmorissette]:

Replying to [comment:11 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).

@mapserver-bot

Author: jparapar
Date: 2007/08/17 - 15:55
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

@mapserver-bot

Author: tomkralidis
Date: 2007/08/17 - 17:51
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.

@mapserver-bot

Author: nsavard
Date: 2007/08/17 - 22:06

I'd like to make sure msautotest is updated (waiting for news from Normand).

Tom, I updated the msautotest related to this problem.

@mapserver-bot

Author: tomkralidis
Date: 2007/08/17 - 23:12
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!

@mapserver-bot

Author: hobu
Date: 2007/08/20 - 06:14
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?

@mapserver-bot

Author: tomkralidis
Date: 2007/08/20 - 06:43
Replying to [comment:28 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.

@mapserver-bot

Author: tomkralidis
Date: 2007/08/20 - 06:44
P.S., I forgot to mention !GetStyles as an operation which has its own parameter specifics.

@mapserver-bot

Author: crschmidt
Date: 2007/09/09 - 17:55
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

@mapserver-bot

Author: tomkralidis
Date: 2007/09/10 - 13:53

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 13a38d3 (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?

@mapserver-bot

Author: crschmidt
Date: 2007/09/10 - 16:38
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.)

@mapserver-bot

Author: tomkralidis
Date: 2007/09/10 - 17:21

Daniel's fix in 062b4ee (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.

@mapserver-bot

Author: jmckenna
Date: 2007/09/11 - 22:42
are there any documentation issues for this ticket?

@mapserver-bot

Author: tomkralidis
Date: 2007/09/12 - 13:10

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

@tomkralidis tomkralidis was assigned Apr 5, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment