[OpenLayers-Users] WFS 2.0.0 and BBOX Strategy

Gabriel Vatin gabriel.vatin at mines-paristech.fr
Thu Jan 3 04:59:36 PST 2013


Hello all,

I'm trying to use WFS 2.0.0 instead of my current WFS 1.0.0 for an 
OpenLayers application. I have GeoServer 2.2.2 for my services, and OL 2.11.
My vector layer is a WFS with a BBX strategy, the JS code is the one below :

new OpenLayers.Layer.Vector('Vessels WFS',
     {
         styleMap: styleVess,
         strategies: [new OpenLayers.Strategy.BBOX()],
         protocol: new OpenLayers.Protocol.HTTP({
         url: local_wfs,
             params: {
                 typename: 'oneday',
                 service: 'WFS',
                 version: '1.0.0',
                 request: 'GetFeature',
                 srs: 'EPSG:4326'
             },
             format: new OpenLayers.Format.GML()
         }),
         inLegend: true,
         visibility: false
     }, {
         extractAttributes: true
     }
)

This produce a GET with this kind of URL : 
http://myhost/wfs?typename=oneday&service=WFS&version=1.0.0&request=GetFeature&srs=EPSG:4326&format=WFS&bbox=4.4653930664063,42.354064941405,10.562805175781,44.293151855469

Ok, that works fine. But when I want to use WFS 2.0.0, it doesn't work 
anymore because of the axis order that is reversed 
(http://docs.geoserver.org/latest/en/user/services/wfs/basics.html#axis-ordering).

I read in a post that adding ",EPSG:4326" at the end of the BBOX 
parameter in the URL fixes the thing. It's true, I can do it "with the 
hand" in my web browser. But the BBOX is automatically created by the OL 
BBOX Strategy, so I can't add the extra comma in the JS parameters.

Does anyone have an idea on how to fix this ? Thank you, and happy new 
year ! :)

Gabriel

-- 

Gabriel Vatin

Doctorant en géomatique / PhD Student in Geomatics
MINES ParisTech
Centre de recherche sur les Risques et les Crises (CRC)
CS 10207
06904 Sophia-Antipolis Cedex - France
Tél : + 33(0)4.93.95.75.77
Fax : + 33(0)4.93.95.75.81
E-mail : gabriel.vatin at mines-paristech.fr 
<mailto:gabriel.vatin at mines-paristech.fr>
Internet : http://www.crc.mines-paristech.fr/ssem
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130103/167eb9e5/attachment.html>


More information about the Users mailing list