Database Reference
In-Depth Information
11. Having seen how the WMS service works, you will now start using WFS.
Like the WMS, the WFS offers the user a
GetCapabilities
request,
as well, resulting in a similar output as the
GetCapabilities
request
ofWMS.TypetheURL,
http://localhost/cgi-bin/mapserv?map=/
var/www/data/coun-
tries.map&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities
,
in the browser window to inspect the XML response.
12. ThemainWFSrequestis
GetFeature
.Itletsyouquerythemaplayerusing
severalcriteria,returningacollectionoffeaturesinresponseas
GML
(
Geo-
graphy Markup Language
) output. Test the request by typing this URL in
the browser:
http://localhost/cgi-bin/mapserv?map=/var/www/
data/coun-
tries.map&SERVICE=WFS&VERSION=1.0.0&REQUEST=getfeature&TYPENAME=countries&MAXFEATURES=5
.
13. YoushouldgetanXML(GML)responsefromthebrowser,asshowninthe
followingcode,witha
<wfs:FeatureCollection>
elementcomposedof
five
<gml:featureMember>
elements (as indicated in the
MAXFEATURES
parameteroftherequest),eachrepresentingonecountry.Foreachfeature,
theWFSreturnsthegeometryandallofthefieldvalues(thisbehaviorwas
specifiedbysettingthe
gml_include_items
variableinthe
METADATA
lay-
er directive in the mapfile).This is the response you should get: