[OpenLayers-Users] Problem with a WFS request
bartvde at osgis.nl
bartvde at osgis.nl
Fri Aug 21 09:18:47 EDT 2009
Hi,
is there any prefix used in your GML, again Mapserver defaults to ms:, so
in that case you need to add:
featureType: "aster_gdem",
featureNS: "http://mapserver.gis.umn.edu/mapserver",
featurePrefix: "ms"
Best regards,
Bart
> Thank you !
>
> Now I think I am close but it's still not working... Vectors are not
> displayed. Do you see where I am wrong ?
>
> 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.Vector("test WFS", {
> strategies: [new OpenLayers.Strategy.BBOX()],
> protocol: new OpenLayers.Protocol.WFS({
> url:
> "http://IP-address/cgi-bin/mapserv_5.4.1?map=/var/www/html/WFS_server/test.map",
> featureType: "aster_gdem",
> featureNS: "http://mapserver.gis.umn.edu/mapserver"
> })
> });
>
> map.addLayers([wms, test_WFS]);
>
> map.zoomToMaxExtent();
> }
>
> Best regards,
>
> Arthur
>
> bartvde at osgis.nl a écrit :
>> 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
>>
>
More information about the Users
mailing list