WFS!

Wow, i actually have a working WFS server now. I was able to successfully use QGIS to call upon the same mapfile using both¬† ‘WMS’ and ‘WFS’ service types. As you can see in the image below, a static baselayer, ‘COUNTY’ (actually a dissolved shp designed to show the physical outline of Washington State) is displayed as WMS layer, as well as WFS layer, ‘NATPARK’, capable of actually identifiying features.

[caption id=“attachment_97” align=“alignnone” width=“300” caption=“QGIS Screenshot: Selected feature in yellow, Identified feature in pinkish-outline.”]wfs_identify[/caption]

I’m amazed at the ability of Mapserver to take a shapefile, turn it into GML, and send it almost magically to ANY program that can interpret it.¬† I’m finally wrapping my noggin around the whole concept of XML, and just how powerful it can be.

So what were my primary issues? Well, it took me about an hour to realize that I was running my, ‘DescribeFeatureType’ request on the mapfile entitled ‘WA_WGS84.map’ rather than ‘WA_WFS_WGS84.map’. So that was my own error. Then I realized that while the KEY field for each of these shapefiles in ArcGIS is simply, ‘FID’, this cannot be used for the ‘gml_featureid’ metadata requirement in the mapfile. Another primary key such as, ‘PARKID’ must instead be used, and the GML file will actually create its own, ‘FID’ based on this.

Some other key lessons from today:

  • ESRI ArcGIS does not support WFS out of the box, as it does WMS. To enable the GML simple features profile, try out this ESRI Help Article.

  • Querying your WFS server in-browser using the, ‘getfeature’ and ‘getcapabilities’ requests is a really simple and effective way of determining which required pieces of information are missing from your XML. Mapserver will actually create a comment in-line saying which required pieces of metadata are missing.

  • Creating metadata abstracts for both WFS and WMS in your mapfile is a simple way to view how your GIS software is consuming the data. For example, the only reason i realized that I was actually using QGIS to display my WFS mapfile as a WMS was through the use both of the “wms_abstract” and “wfs_abstract” metadata tags.

What’s next? Wrap an openlayers display around this with selection and identify capabilities.

Comments