[OpenLayers-Users] Problem with a WFS request

bartvde at osgis.nl bartvde at osgis.nl
Fri Aug 21 07:05:15 EDT 2009


Hi Arthur,

yes the BBOX strategy will take care of that.

The GML version is determined by the protocol version, WFS 1.0 is tied to
GML2, whereas WFS 1.1 is tied to GML3. The WFS protocol version defaults
to 1.0, so you will get the Format.GML.v2 parser. So you should not need
to change anything.

You can retrieve the url for featureNS from a WFS DescribeFeatureType
request (intranet url, for example only):

http://test.intranet.rijkswaterstaat.nl/services/geoservices/overzichtskaartnl?service=WFS&request=DescribeFeatureType&version=1.0.0

then check the source and look for targetNamespace, by default this is
http://mapserver.gis.umn.edu/mapserver

Best regards,
Bart

> Thank you for your answer.
>
> If I understand, the BBOX strategy option will do the stuff with the
> limits to take into account for not reading the whole data. I have some
> other questions :
>
> - I am not sure which URL to put for "featureNS"?
> - I also had a problem of GML format : I used the option
> OUTPUTFORMAT=GML2 in the URL request, because I could not make
> OpenLayers read GML3 (it's probably possible but I don't know how). How
> can I put this option in the code of the layer ? If it's not possible,
> how can I read the GML3 Mapserver is generating with OpenLayers ?
>
> Best regards,
>
> Arthur
>
> bartvde at osgis.nl a écrit :
>> Hi,
>>
>> please check examples\wfs-protocol.html for the right way to do this as
>> of
>> OpenLayers 2.8.
>>
>> Best regards,
>> Bart
>>
>>
>>> Hello,
>>>
>>> I am trying to display part of the data of a big shapefile with a WFS
>>> request and BBOX to filter the data and display only the vectors
>>> contained in the map view.
>>>
>>> I just finished configuring the WFS server (Mapserver) : URL request is
>>> working and I could read the XML that I saved in a file with OpenLayers
>>> (for testing). Now I try to make the WFS request with OpenLayers and I
>>> don't understand what is the problem. I tried two solutions based on
>>> what I found on the net. Here is my OpenLayers code :
>>>
>>>
>>> var map, wms, test_WFS;
>>> function init()
>>> {
>>>     map = new OpenLayers.Map('map', {
>>>         controls: [new OpenLayers.Control.Navigation(),
>>>             new OpenLayers.Control.PanZoom(),
>>>             new OpenLayers.Control.LayerSwitcher()
>>>             ]
>>>         });
>>>
>>>     wms = new OpenLayers.Layer.WMS("OpenLayers WMS",
>>>         "http://labs.metacarta.com/wms/vmap0",
>>>         {layers:'basic'
>>>         });
>>>
>>> //  test_WFS = new OpenLayers.Layer.WFS("test WFS",
>>> //
>>> "http://IP-address/cgi-bin/mapserv_5.4.1?map=/var/www/html/WFS_server/test.map&",
>>> //      {service:'WFS', version:'1.1.0', request:'GetFeature',
>>> bbox:'70,35,75,37', typeName:'aster_gdem', outputFormat:'GML2'},
>>> //      {}
>>> //      );
>>>
>>>     test_WFS = new OpenLayers.Layer.GML("test WFS", [
>>>         "http://IP-address/cgi-bin/mapserv_5.4.1",
>>>         "?map=/var/www/html/WFS_server/test.map",
>>>         "&SERVICE=WFS",
>>>         "&VERSION=1.1.0",
>>>         "&REQUEST=GetFeature",
>>>         "&BBOX=70,35,75,37",
>>>         "&TYPENAME=aster_gdem",
>>>         "&OUTPUTFORMAT=GML2"].join(",")
>>>         );
>>>
>>>     map.addLayers([wms, test_WFS]);
>>>
>>>     map.zoomToMaxExtent();
>>> }
>>>
>>>
>>> The test_WFS layer is not displaying and I don't know how to fix it.
>>>
>>> Thank you for your help !
>>>
>>> Arthur Delorme
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at openlayers.org
>>> http://openlayers.org/mailman/listinfo/users
>>>
>>>
>>
>>
>>
>>
>





More information about the Users mailing list