2

When clicking some features on the map to get feature information in OpenLayers (as part of a GetFeature request) I'm getting also information of other nearby features that I'm not clicking on.

I've notice that this is more accurate in GeoServer 2.6-RC1 but at the moment this version is failing me in quite important operations like queries of this sort that are working in version 2.5.2:

http://localhost:8080/geoserver/wms?service=WFS&version=1.0.0&request=GetFeature&typename=mittic:Geral&PROPERTYNAME=land_cultu&OUTPUTFORMAT=application/json&

I can't use the maxFeatures parameter because sometimes I have overlapping features and I need the information of both.

So far I've tried setting the Default Rendering Buffer parameter in the web interface, setting buffer to a small value in vendor parameters in code but nothing makes any changes.

Any help?


(Edited to include issues print screens)

Difference in accuracy: (red dot is where I click. Feature id 48 is the yellow one below

2.6:

2.6

2.5.2: 2.5.2

GetFeature query working in 2.5.2 and failing in 2.6-RC1

working

working

  • What fails with your GetFeature? This is OK for me with GeoServer 2.6 snapshot http://localhost:8080/geoserver/wms?service=WFS&version=1.0.0&request=GetFeature&typename=topp:states&PROPERTYNAME=STATE_NAME&OUTPUTFORMAT=application/json – user30184 Sep 18 '14 at 10:11
  • Can you reproduce the non-accurate GetFeatureInfo by adding some of the demo layers into your OpenLayers app? If you can, capture the request with Firebug and share it. – user30184 Sep 18 '14 at 10:16
  • edited to include prints – Miguel Ângelo Belém Sep 18 '14 at 10:44
1

So I looked for similar issues in the bug report section and found a similar discution.

Adding this arg to the startup.bat seems to fix it for me...

-Dorg.geoserver.wms.featureinfo.render.enabled=false

http://jira.codehaus.org/browse/GEOS-6572

0

You have done the right things for reducing the search distance. On the server side the default buffer is set from the layer settings with "Default Rendering Buffer" parameter. Clients can override this setting by adding a vendor parameter "buffer" http://docs.geoserver.org/stable/en/user/services/wms/vendor.html#wms-vendor-parameters.

You can test the effect of the buffer setting with the following requests. With GeoServer 2.6-RC1 the first query finds one state, second one two states, and the third finds three. The unit of buffer is pixels.

http://localhost:8080/geoserver/wms?INFO_FORMAT=text/html&BBOX=-106.850154,32.510209,-84.851117,41.817493&QUERY_LAYERS=topp:states&SERVICE=WMS&HEIGHT=330&REQUEST=GetFeatureInfo&STYLES=&WIDTH=780&EXCEPTIONS=application/vnd.ogc.se_xml&FEATURE_COUNT=50&VERSION=1.1.1&FORMAT=image/png&LAYERS=topp:states&Y=244&X=636&SRS=EPSG:4326&buffer=1

http://localhost:8080/geoserver/wms?INFO_FORMAT=text/html&BBOX=-106.850154,32.510209,-84.851117,41.817493&QUERY_LAYERS=topp:states&SERVICE=WMS&HEIGHT=330&REQUEST=GetFeatureInfo&STYLES=&WIDTH=780&EXCEPTIONS=application/vnd.ogc.se_xml&FEATURE_COUNT=50&VERSION=1.1.1&FORMAT=image/png&LAYERS=topp:states&Y=244&X=636&SRS=EPSG:4326&buffer=5

http://localhost:8080/geoserver/wms?INFO_FORMAT=text/html&BBOX=-106.850154,32.510209,-84.851117,41.817493&QUERY_LAYERS=topp:states&SERVICE=WMS&HEIGHT=330&REQUEST=GetFeatureInfo&STYLES=&WIDTH=780&EXCEPTIONS=application/vnd.ogc.se_xml&FEATURE_COUNT=50&VERSION=1.1.1&FORMAT=image/png&LAYERS=topp:states&Y=244&X=636&SRS=EPSG:4326&buffer=50

In your example the buffer in GeoServer 2.5.2 seems to be very large. Can you reproduce similar result with topp:states? I ask for eliminating the possibility that the issue has something to do with your dataset.

Same applies to your GetFeature in geojson with limited propertylist. Can you repeat it with topp:states with request

http://localhost:8080/geoserver/wms?service=WFS&version=1.0.0&request=GetFeatur‌​e&typename=topp:states&PROPERTYNAME=STATE_NAME&OUTPUTFORMAT=application/json

If you can't reproduce the error with the demo datasets anyone who would like to help you with debugging will need test data from you.

  • Yes i can reproduce both issues in topp:states. For example if you click the west virginia feature, sometimes you will get the information of the surrounding states, even if you set the "Default Rendering Buffer" parameter to 1 or 0. In this case setting it to 100 will expand the search, so the parameter seems to be working. But the minimum isn't precise enough. In my example i'm using a large zoom. – Miguel Ângelo Belém Sep 18 '14 at 13:24
  • I can reproduce that with GeoServer 2.5.2. It is a current stable version so you can make a bug report. However, try also the nightly build of version 2.6. If your geojson trouble has been corrected you can update. – user30184 Sep 18 '14 at 13:45
  • Thank you for helping isolate the problem. Sorry i can't vote up your answer yet. My rep isn't high enough. – Miguel Ângelo Belém Sep 18 '14 at 13:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.