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

Tom B seileef at gmail.com
Wed Jun 24 17:14:07 EDT 2009


Hi Andreas,

Thanks for the help.  I should've mentioned that the map also has features
that are points, and GetFeatureInfo's tolerance wasn't quite wide enough for
how we are displaying them; that was the big impetus for using GetFeature.  

Additionally, the user will be dynamically adding and removing many
different WMS layers, and the GetFeature request needs to include all of
those layers, so making a custom GetFeature request seemed much easier than
using the GetFeature control.

Yes, I've been using Firebug to double-check these requests; everything
looks good as far as I can tell.  I think I might go ahead and ask the
GeoServer list--in retrospect, it seems like that's closer to where the
problem probably lies.

Thanks again,
Tom


 

Andreas Hocevar-2 wrote:
> 
> Hi,
> 
> On Wed, Jun 24, 2009 at 7:36 PM, Tom B<seileef at gmail.com> wrote:
>> 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.
> 
> First of all, if you are using GeoServer >= 1.7.4, GetFeatureInfo is
> smart enough to select point and line features when clicking anywhere
> on the feature, not just the within two pixels of the center.
> 
> Also, there is a GetFeature control that you may want to have a look
> at: http://www.openlayers.org/dev/examples/getfeature-wfs.html
> 
>> 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.
> 
> This is weird. Have you looked at the requests in Firebug to make sure
> that what gets sent to the server is what you intended to?
> 
>> 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.
> 
> Also weird. If you have more troubles with that, collect some sample
> requests (e.g. by copying the request strings from the firebug
> console), and ask on the geoserver users list.
> 
> Regards,
> Andreas.
> 
>> 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.
>>
>> _______________________________________________
>> Users mailing list
>> Users at openlayers.org
>> http://openlayers.org/mailman/listinfo/users
>>
> 
> 
> 
> -- 
> Andreas Hocevar
> OpenGeo - http://opengeo.org/
> Expert service straight from the developers.
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
> 
> 

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




More information about the Users mailing list