[OpenLayers-Users] WFS GetFeature with Mapserver
Attila Berényi
atis at airdesignstudio.hu
Wed Apr 7 05:20:00 EDT 2010
Dear All,
Finally I've succeed applying WFS GetFeature (based on the GeoServer
example here: http://openlayers.org/dev/examples/getfeature-wfs.html)
with MapServer, and hereby I will share my experiences to give some
help for the users with the same problem.
So, using WFS GetFeature function needs a few things to be done to
work correctly:
1. Take care if you use the sample wrapper CGI from here
http://mapserver.org/cgi/wrapper.html, it accepts only GET requests,
and you need POST. Pick one from these
http://mapserver.org/ogc/wms_server.html#more-about-the-online-resource-url
instead.
2. The lastest MapServer (as of now 5.6.3) needs to be patched in
order to return geometry on WFS requests (needed for e.g. highlight
functions), see: http://trac.osgeo.org/mapserver/ticket/3235
3. You need to set a few extra arguments to
OpenLayers.Protocol.WFS.fromWMSLayer, such as featurePrefix,
geometryName and featureType.
Thanks to all who helped me, and I hope this would be useful, you can
see a working example (with hover and selection functionality) here:
http://webgis.fmt.bme.hu/gfi/t4.html. I'm sorry, this is an old
server, it might be slow.
Now I try to apply this function for multiple typenames (layers), but
that worth a different thread :)
BR,
Attila
Idézet (Balázs Szabó <szabobaa at gmail.com>):
> hi
>
> You must to set your wms_onlineresource (your getCababilities should be work
> on that url:
> http://webgis.fmt.bme.hu/cgi-bin/mvmNew&SERVICE=WMS&VERSION=1.1.1&REQUEST=getCapabilities&if
> you are using wrapper script check it!).
> However I think you neednt set the WFS (this is WFS.fromWMSLayer), but I am
> not sure on this (I can't check it, beacouse something wrong with the
> Openlayers server).
>
> BAlazs
>
> 2010. március 17. 21:52 Attila BERÉNYI írta, <atis at airdesignstudio.hu>:
>
>> Hi,
>>
>> I've tested GML3 output - no success :( - that's why this row appeared in
>> the code.
>> Anyway, thank you for letting me know, I've corrected it.
>>
>> BR,
>> Attila
>>
>> 2010.03.17. 21:12 keltezéssel, Balázs Szabó írta:
>>
>> Hi
>>
>> layer = new OpenLayers.Layer.WMS("elteresek", "
>> http://webgis.fmt.bme.hu/cgi-bin/mvmNew?OUTPUTFORMAT=gml&" ......
>>
>> I think this row is wrong, gml it isnt valid wms url!
>>
>> Balazs
>>
>> 2010/3/17 Attila Berényi <atis at airdesignstudio.hu>
>>
>>> Dear All,
>>>
>>> I'd like to create something similar to this
>>> http://openlayers.org/dev/examples/getfeature-wfs.html only
>>> difference, that I'd like to use Mapserver. This is the actual state:
>>> http://webgis.fmt.bme.hu/gfi/t4.html, the according WFS dump:
>>>
>>> http://webgis.fmt.bme.hu/cgi-bin/mvmNew?SERVICE=WFS&VERSION=1.0.0&REQUEST=getfeature&TYPENAME=elteresek
>>> <
>>> http://webgis.fmt.bme.hu/cgi-bin/mvmNew?SERVICE=WFS&VERSION=1.0.0&REQUEST=getfeature&TYPENAME=elteresek
>>> >
>>>
>>> I've configured featureNS, featurePrefix, featureType, layerName,
>>> version and geometryName properly, but the events aren't fired...
>>>
>>> Could someone help me?
>>>
>>> Thanks,
>>> Attila
>>> _______________________________________________
>>> Users mailing list
>>> Users at openlayers.org
>>> http://openlayers.org/mailman/listinfo/users
>>>
>>
>>
>
More information about the Users
mailing list