Capabilities

 < Day Day Up > 

Web Feature Service (WFS)

WFS is an Open Geospatial Consortium specification. For more information about the format itself, see http://www.opengeospatial.org/.

WFS allows a client to retrieve geospatial data encoded in Geography Markup Language (GML) from multiple Web Feature Services. GML is built on the standard web language XML.

WFS differs from the popular Web Map Service specification in that WFS returns a subset of the data in valid GML format, not just a graphic image of data.

Requesting capabilities using the GetCapabilities request to a WFS server returns an XML document showing what layers and projections are available, etc.

Example of a WFS GetCapabilities URL

     http://www2.dmsolutions.ca/cgi-bin/mswfs_gmap     ?VERSION=1.0.0     &SERVICE=wfs     &REQUEST=GetCapabilities 

Example of the resulting XML from GetCapabilties

Example B-1. Resulting XML from GetCapabilities
 ... <FeatureTypeList>  <Operations>   <Query/>  </Operations>    <FeatureType>     <Name>park</Name>     <Title>Parks</Title>     <SRS>EPSG:42304</SRS>     <LatLongBoundingBox minx="-173.433" miny="41.4271" maxx="-13.0481" maxy="83.7466" />   </FeatureType>   <FeatureType>     <Name>road</Name>     <Title>Roads</Title>     <SRS>EPSG:42304</SRS>     <LatLongBoundingBox minx="-148.059" miny="35.882" maxx="-33.7745" maxy="72.5503" />    </FeatureType>    <FeatureType>      <Name>popplace</Name>      <Title>Cities</Title>      <SRS>EPSG:42304</SRS>      <LatLongBoundingBox minx="-172.301" miny="36.3541" maxx="-12.9698" maxy="83.4832" />  </FeatureType>  </FeatureTypeList> ... 

Data access/connection method

  • WFS access is a core MapServer feature.

  • MapServer currently supports WFS Version 1.0.0.

  • The CONNECTIONTYPE WFS parameter must be used.

WFS layers can be requested through a layer in a map file, or you can request the GML directly through the browser with a GetFeature request. You can specify a specific layer with the TypeName request. In a map file, the name/value pairs should be put into a METADATA object.

You can limit the number of features returned in the GML by using the MaxFeatures option (e.g., &MAXFEATURES=100).

Example of a WFS request directly through the browser

The following URL requests the GML for the layer road (see the earlier section, "Capabilities," for the possible layers available on this test server). The URL is all one line, broken up here for readability.

     http://www2.dmsolutions.ca/cgi-bin/mswfs_gmap     ?VERSION=1.0.0     &SERVICE=wfs     &REQUEST=getfeature&TYPENAME=road 

Map file example

     LAYER       NAME "wfs_gmap_roads"       STATUS DEFAULT       TYPE LINE       CONNECTIONTYPE WFS       CONNECTION "http://www2.dmsolutions.ca/cgi-bin/mswfs_gmap?       METADATA         "wfs_version" "1.0.0"         "wfs_srs" "EPSG:42304"         "wfs_typename" "road"         "wfs_request_method" "GET"         "wfs_service" "WFS"       END       CLASS         NAME "roads"         COLOR 0 0 0       END     END  # layer 

     < Day Day Up > 


    Web Mapping
    Web Mapping Illustrated: Using Open Source GIS Toolkits
    ISBN: 0596008651
    EAN: 2147483647
    Year: 2005
    Pages: 138

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net