[OpenLayers-Users] Spatial constraints of a WFS GetFeature request

Tom B seileef at gmail.com
Wed Jun 24 13:36:09 EDT 2009


Hi all,

I'm trying to allows users to click on a WMS overlay and get a popup showing
a list of features at the location they clicked.  It's a setup similar to
http://trac.openlayers.org/wiki/GetFeatureInfo, but instead of a WMS
GetFeatureInfo request, I'm using WFS GetFeature, since it allows me to make
the area queried a little larger than just the single pixel that the mouse
clicked.

When I set the CQL_FILTER param to 
BBOX(geometry,'+left+','+bottom+','+right+','+top+')

and, for example, click on a county, the result often includes neighboring
counties as well, even when left==right and top==bottom.

As an alternative, I tried using INTERSECT instead of BBOX, like this:
clicked_bounds = new OpenLayers.Bounds(left, bottom, right, top);
geometryString = clicked_bounds.toGeometry().toString();
cql_filter = 'INTERSECT(geometry,'+geometryString+')';

With this, some counties show up fine when you click on them (i.e. no
neighboring counties are listed), but other counties never show up in the
results, regardless of where you click on them.

Does any have any ideas of what might be the issue with either of these? 
I'm a bit lost on where to start, and I don't have the access necessary to
see what queries GeoServer is making against the database.  

Best,
Tom
-- 
View this message in context: http://n2.nabble.com/Spatial-constraints-of-a-WFS-GetFeature-request-tp3150234p3150234.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list