0

I have two layers served via GeoServer: "locations and "forests".

I'm using GetFeatureInfo request to query the layers like this:

mysite.net/geoserver/project/wms?REQUEST=GetFeatureInfo&SERVICE=WMS&SRS=EPSG%3A4326&STYLES=&TRANSPARENT=true&VERSION=1.1.1&FORMAT=image%2Fpng&BBOX=16.52648448944092%2C45.730599026324924%2C16.569614410400394%2C45.7570142556995&HEIGHT=882&WIDTH=1005&LAYERS=project%3Alocations%2project%3Aforests&QUERY_LAYERS=project%3Alocations%2Cproject%3Aforests&INFO_FORMAT=text%2Fhtml&X=383&Y=390

This works fine, but in cases where layers overlap, I get only the response for first layer (locations), and I need featureInfo for both layers. What am I missing?

  • 1
    Try to add &FEATURE_COUNT=10 – user30184 Oct 1 at 12:30
  • It worked, thanks. I suppose &FEATURE_COUNT=2 would suffice for two layers? – Marin Leontenko Oct 1 at 12:33
  • 2
    It's interesting that in the WMS 1.3.0 specification we have The optional FEATURE_COUNT parameter states the maximum number of features per layer for which feature information shall be returned. whilst in the WMS 1.1.1 specification it doesn't mention per layer – nmtoken Oct 1 at 12:40
  • 1
    Geoserver is using a buffer when it processes the GetFeatureInfo request. The buffer can be set in request, or it may be a fixed value that is configured on the server side, or server sets is automatically with complex heuristics, which is the default docs.geoserver.org/stable/en/user/services/wms/…. This means that GetFeatureInfo may find several hits from a layer and it may be safer to use a somewhat bigger value as FEATURE_COUNT. – user30184 Oct 1 at 13:30

Your Answer

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

Browse other questions tagged or ask your own question.