Ticket #842 (closed defect: fixed)

Opened 9 years ago

Last modified 3 years ago

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) (diff)

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

bug842.zip Download (0.7 KB) - added by assefa 3 years ago.
simplified patch

Change History

Changed 9 years ago by doug@…

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.

Changed 9 years ago by assefa

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

 

Changed 5 years ago by dmorissette

  • cc assefa added
  • owner changed from mapserverbugs to dmorissette
  • description modified (diff)
  • milestone set to 5.2 release

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

This would be nice to fix in 5.2.

Changed 5 years ago by dmorissette

  • description modified (diff)

Changed 5 years ago by dmorissette

  • milestone changed from 5.2 release to 5.4 release

Changed 4 years ago by bartvde

See also ticket:2911

Changed 4 years ago by dmorissette

  • milestone changed from 5.4 release to 6.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.

Changed 3 years ago by assefa

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

Changed 3 years ago by assefa

simplified patch

Changed 3 years ago by dmorissette

  • cc dmorissette added
  • owner changed from dmorissette to assefa

Changed 3 years ago by assefa

committed in trunk r9587

Changed 3 years ago by bartvde

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

Tested and verified, works okay. Thanks.

Note: See TracTickets for help on using tickets.