[OpenLayers-Dev] Connecting to a WFS server

Daniel Behr daniel.behr at hzg.de
Wed Feb 9 02:07:06 EST 2011


first I would try it with Strategy.Fixed instead of Strategy.BBOX (if 
your amount of data allows this) and maybe add version: "1.1.0" (or 
1.0.0 depending on what you have) to your Protocol.WFS parameters.

this might help to define the error.

Dan


Am 08.02.2011 18:56, schrieb Andrés Maneiro:
> Hello Xurxo,
>
> thanks for pointing me in that direction. Nevertheless, altough I've
> tested several combinations of featureNS/featurePrefix/featureTypename,
> I didn't get the map to work, neither I understand what that parameters
> are for.
>
> If I have URI in [1], how do I know the values of
> featureNS/featurePrefix/featureTypename?
>
> [1]
> http://localhost:8080/geoserver/wfs?request=getfeature&typename=Galicia:CONCELLO_25
>
>
> Besides, any other help to find the bug will be very valuable.
>
> best,
> amaneiro
>
> On 07/02/11 20:26, Xurxo Mendez wrote:
>> Hi Andrés,
>>
>> I didn't test it, I'm talking from memory... Assumming the namespaces
>> are ok, have you tried specifying the feature prefix? Something like
>> this:
>>
>> 1.
>> var wfslayer = new OpenLayers.Layer.Vector(
>> 2.
>> "Concellos Galicia (WFS)",
>> 3.
>> {strategies: [new OpenLayers.Strategy.BBOX()],
>> 4.
>> protocol: new OpenLayers.Protocol.WFS({
>> 5.
>> url: "http://localhost:8080/geoserver/wfs",
>> 6.
>> featureType: "CONCELLO_25",
>> 7. featurePrefix: "Galicia"
>> 8.
>> featureNS: "http://www.openplans.org/topp"
>> 9.
>> })
>> 10.
>> }
>> 11.
>> );
>>
>>
>> Best regards,
>>
>> Xurxo Méndez Pérez
>>
>> http://www.sonxurxo.com <http://www.sonxurxo.com/>
>>
>>
>> 2011/2/7 Andrés Maneiro <amaneiro at icarto.es <mailto:amaneiro at icarto.es>>
>>
>> Hello,
>>
>> I'm trying to connect to a WFS server by means of OpenLayers
>> capabilities.
>>
>> If it can help, I'm using geoserver 2.1 from the trunk (the one
>> package by the opengeo-suite [1]). These tests on the WFS server are OK:
>>
>> - connect to WFS server by using a desktop client (QGIS) and get a layer
>> - get a GML file directly from the browser with this query
>> http://localhost:8080/geoserver/wfs?request=getfeature&typename=Galicia:CONCELLO_25
>>
>> <http://localhost:8080/geoserver/wfs?request=getfeature&typename=Galicia:CONCELLO_25>
>>
>>
>> So, it seems the WFS is ok and running. Nevertheless, when I trying
>> to connect from OL I failed to use it. The map generated shows the
>> OSM baselayer + WMS layer overlay. But not the WFS layer. The code
>> I'm using:
>>
>> HTML code: http://pastebin.com/S0E1Wu8C
>> Javascript code: http://pastebin.com/nzum0CbJ
>>
>> I can't figure out why it fails. Any idea?
>>
>> best,
>> amaneiro
>>
>> [1] http://opengeo.org/technology/suite/whatsnew/
>> _______________________________________________
>> Dev mailing list
>> Dev at lists.osgeo.org <mailto:Dev at lists.osgeo.org>
>> http://lists.osgeo.org/mailman/listinfo/openlayers-dev
>>
>>
> _______________________________________________
> Dev mailing list
> Dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-dev


More information about the Dev mailing list