GeoServer Point Stacker: does identify work on non-clustered points?

Your problem is related to Geoserver issue https://osgeo-org.atlassian.net/projects/GEOS/issues/GEOS-5228. See also discussion http://comments.gmane.org/gmane.comp.gis.geoserver.user/39166.

I understood that you want to get feature info only when user has zoomed in so much that points are not stacked together but a symbol marks exactly one point in the original data. In that case the symbol is in the same place than if you have a layer without the pointstacker SLD. Perhaps not exactly because the rendering machine can move the symbols a bit but close anyhow. In that case you should be able to use simple workaround: make your application to send GetFeatureInfo with &STYLES= pointing to a non-stacked style which may be "point" in your case. The following example shows how a GetFeatureInfo request looks like and you can see where to do the change.

http://localhost:8080/geoserver/wms?bbox=-130,24,-66,50&styles=population&format=jpeg&info_format=text/plain&request=GetFeatureInfo&layers=topp:states&query_layers=topp:states&width=550&height=250&x=170&y=160

Another workaround could be to to make a second layer "osm_civici_postgis_query" and use that only for GetFeatureRequests so that when your user clicks on the map the &layers and &query_layers parametes would automatically changed from "osm_civici_postgis" into "osm_civice_postgis_query". Because these two layer may not have the symbols exactly in the same place it might be good to add some tolerance with the "buffer" vendor option http://docs.geoserver.org/latest/en/user/services/wms/vendor.html. A large buffer may find more than one feature sometimes so I would also add for example &feature_count=10 to make the query to return more hits in such case. The default value is 1 and then user would get only one feature and that is not necessarily the closest feature from the clicked point because Geoserver does not sort the GetFeatureInfo results by the distance.

Tags:

Geoserver