Opened 20 years ago

Closed 15 years ago

#842 closed defect (fixed)

WMS GetFeatureInfo beyond scale?

Reported by: doug@… Owned by: assefa
Priority: high Milestone: 6.0 release
Component: WMS Server Version: 4.2
Severity: normal Keywords:
Cc: assefa, dmorissette

Description (last modified by dmorissette)

I don't know if I would call this a bug, but the current behaviour of MapServer's WMS GetFeatureInfo is to allow a request to be made even when the layer is not shown on the map (outside of its scale range). I think that the scale dependencies of a layer should be respected for both the GetMap and GetFeatureInfo requests, and a request made using BBOX where the layer wouldn't be visible should return an exception.

Attachments (1)

bug842.zip (763 bytes ) - added by assefa 15 years ago.
simplified patch

Download all attachments as: .zip

Change History (13)

comment:1 by doug@…, 20 years ago

Test case (may not be permanently available):
Version 4.2.3
Note: Feature geometry suppressed by code change.

GetMap (empty image returned because out of scale):

http://www.moxi.ca/wms/gisi?VERSION=1.1.1&REQUEST=GetMap&LAYERS=ROADS&STYLES=&SRS=EPSG%3A4326&BBOX=-123.15395251488823,49.244232067451485,-123.08537775741607,49.31280682492365&WIDTH=350&HEIGHT=350&FORMAT=image/png&TRANSPARENT=TRUE&EXCEPTIONS=application/vnd.ogc.se_inimage&

GetFeatureInfo (same map parameters):

http://www.moxi.ca/wms/gisi?VERSION=1.1.1&REQUEST=GetFeatureInfo&LAYERS=ROADS&STYLES=&SRS=EPSG%3A4326&BBOX=-123.15395251488823,49.244232067451485,-123.08537775741607,49.31280682492365&WIDTH=350&HEIGHT=350&FORMAT=image/png&QUERY_LAYERS=ROADS&INFO_FORMAT=application/vnd.ogc.gml&FEATURE_COUNT=25&X=147&Y=164&

... returns a bunch of results.

comment:2 by assefa, 20 years ago

looking into this. When I quickly checked the code It seemed that this shoudl 
not be happen (the map extents/width are modified before the query is done so 
the query should have failed if layer was out of sacale).

BTW : before I check this I just checked the gml file returned from your 
requests and there seems to be no geometry component in it ? Is this a problem 
with the data ? That could explain why we do not see anything in the GetMap 
request.  Can you please check this aspect for me ?

<msGMLOutput 
	 xmlns:gml="http://www.opengis.net/gml"
	 xmlns:xlink="http://www.w3.org/1999/xlink"
	 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<ROADS_layer>
		<ROADS_feature>
			<gid>61520</gid>
			<streetname>Nelson St</streetname>
			<aliasname></aliasname>
			<rd_class>local</rd_class>
			<rd_classid>8</rd_classid>
		</ROADS_feature>
                 ...
 

 

comment:3 by dmorissette, 17 years ago

Cc: assefa added
Description: modified (diff)
Milestone: 5.2 release
Owner: changed from mapserverbugs to dmorissette

I have had reports that scale is ignored by GetFeatureInfo in MapServer 5.0.

This would be nice to fix in 5.2.

comment:4 by dmorissette, 17 years ago

Description: modified (diff)

comment:5 by dmorissette, 16 years ago

Milestone: 5.2 release5.4 release

comment:6 by bartvde, 15 years ago

See also ticket:2911

comment:7 by dmorissette, 15 years ago

Milestone: 5.4 release6.0 release

Copying a ref to the relevant WMS-dev thread here:

http://lists.osgeo.org/pipermail/mapserver-dev/2009-February/008365.html

Keith Pomakis wrote:
bartvde at osgis.nl wrote:
> I could not find anything in the WMS spec about what a WMS should do if it
> receives a GetFeatureInfo request for a layer which is not visible at the
> scale of the map.
> 
> Should it return the feature info anyway even though the layer is not
> visible, or not?
> 
> For instance I am using a group of layers, i.e. layers=A,B,C where A, B
> and C are all the same data but represented at different scales. So e.g.
> at 1:100000 A becomes invisible and B becomes visible.
> 
> But when I do a GetFeatureInfo request on UMN Mapserver in this case for
> query_layers=A,B,C I get back 3 responses, but I would hope for only 1.
> Since in the current situation I as a WMS client have to filter out the
> right one from the response based on the scales of the layers, otherwise I
> would be presenting information (e.g. height) which is not valid/excact at
> the current map scale.

All the WMS specification says about this is:

    The actual semantics of how a WMS decides what to return more
    information about, or what exactly to return, are left up to the
    WMS provider.

However, the spirit of the WMS GetFeatureInfo request, at least in my
opinion, is as you say.  It should endeavor to only return information
on visible features.  (Perhaps this should be stated more explicitly
in the specification.)  The current scale may affect this, of course,
as may filters in the selected style.

comment:8 by assefa, 15 years ago

to be applied after the 5.6 release. entry msautotest needs to be added.

by assefa, 15 years ago

Attachment: bug842.zip added

simplified patch

comment:10 by dmorissette, 15 years ago

Cc: dmorissette added
Owner: changed from dmorissette to assefa

comment:11 by assefa, 15 years ago

committed in trunk r9587

comment:12 by bartvde, 15 years ago

Resolution: fixed
Status: newclosed

Tested and verified, works okay. Thanks.

Note: See TracTickets for help on using tickets.