GetFeatureInfo on a WMS layer returns the incorrect values

4083
1
Jump to solution
08-22-2013 11:29 PM
StephenLead
Regular Contributor III
I've added a WMS layer to a Web Mercator map, using the new esri.layers.WMSLayer() method, and now I'm attempting to set up an Identify function to return the WMS layer's values when the user clicks on the map.

I'm running a GetFeatureInfo request using the current map extent (in Web Mercator) and the location clicked. This works correctly if I click in the middle of a polygon - but in many cases the returned value is incorrect, and represents an adjacent polygon.

See the sample page here - if you click on the "C" of "Clamgoose Lane" the returned value is the 011C polygon, when the correct value should be 010B.

Firebug shows the GetMap request is:

BBOX=-224655.00820762033,6981963.631850611,-220642.0642225429,6984051.318185706
CRS=EPSG:102100
FORMAT=image/png
HEIGHT=874
LAYERS=0
REQUEST=GetMap
SERVICE=WMS
STYLES=
TRANSPARENT=TRUE
VERSION=1.3.0
WIDTH=1680



while the GetFeatureInfo request is:


BBOX=-224655.00820762033,6981963.631850611,-220642.0642225429,6984051.318185706
BGCOLOR=0xFFFFFF
FORMAT=text/xml
HEIGHT=874
LAYERS=0
QUERY_LAYERS=0
REQUEST=GetFeatureInfo
SERVICE=WMS
SRS=EPSG:102100
STYLES=
TRANSPARENT=TRUE
VERSION=1.1.1
WIDTH=1680
X=640
Y=431
https://mapping.statistics.gov.uk/arcgis/services/LSOA/LSOA_2011_EW_BFC/MapServer/WMSServer?=



I noticed that the version (1.3.0 vs 1.1.1) and the spatial reference (CRS vs SRS) differs between the requests, but when I try using the 1.3.0 syntax on the GetFeatureInfo request, I get an error message saying that the format is invalid. Here is the request that I'm trying, and the response:

Parameter 'InfoFormat' contains unacceptable value.
 
What is the correct syntax for a GetFeatureInfo request using version 1.3.0? Why would the result be slightly inaccurate, ie showing the adjacent polygon? It's almost like there's a datum shift?

Thanks,
Steve
0 Kudos
1 Solution

Accepted Solutions
StephenLead
Regular Contributor III
The answer to the first problem came via some help from GIS.StackExchange user oyvind.

I was sending the XY location for the GetFeatureInfo using evt.screenX and evt.screenY. This was subtly different from evt.screenPoint.x and evt.screenPoint.y

View solution in original post

0 Kudos
1 Reply
StephenLead
Regular Contributor III
The answer to the first problem came via some help from GIS.StackExchange user oyvind.

I was sending the XY location for the GetFeatureInfo using evt.screenX and evt.screenY. This was subtly different from evt.screenPoint.x and evt.screenPoint.y
0 Kudos