Note¶
This page is currently a barely-modified copy from an email I wrote to the QGIS Developers list on 10 March 2006. I hope to flesh it out as I discover more about an appropriate WFS Client implementation architecture.
Discussion¶
After a conversation with "what_nick" on IRC, I had a look at the literature regarding the OGC WFS and its dependencies.
Review¶
WFS requires an implementation of GML to view features and a naive view of feature attributes (this is similar to our other read-only vector providers).
WFS requires an implementation of XSD (XML Schema) to view the attributes of features meaningfully, and to provide write support.
There is an implementation of GML in OGR, but I think it may be a bit clunky for QGIS use. We have a precedent here in that the PostGIS provider has been reimplemented from the OGR version.
There doesn't appear to be any signs of an XSD implementation in Qt.
What needs to be done?¶
Conceptually, we could set up a Qt Model (in the model/view framework) that understands XML documents with attached XSD.
This can then be paired up with a XSD-aware Form View, that not only understands the usual Qt4 "ItemDataRole"s, but also extends with user roles such as maxLength, datatypes etc. This would be useful so that users could edit the data in a QLineEdit with the appropriate editing restrictions up front (e.g. stop a user from typing in too many characters).
The XSD-aware Form View would be shown whenever a user wanted to Identify a Feature.
Implications¶
I want to set up a new Subversion Branch straight away, e.g. over the weekend. Suggested name is: branches/Wfs-branch/
Almost straight-up, the qgis/src/providers/wms directory would be "pushed down" into a new heirarchy so that all the OGC implementations can be grouped together, e.g.
qgis
src
providers
ogc (Instead of wms)
gml ows (OGC Web Services)
(QgsHttpTransaction moved here, shared amongst wfs and wms)
wfs wms (wms moved here)
Also, a new directory structure in src:
qgis
src
models
xsd (XML+XSD Qt Model)
Fears¶
If it were just me working on this, we may not have anything to show for a couple of years!
The XML+XSD model could be of value elsewhere for Qt developers and we may get a few extra hands if marketed/managed appropriately.
BrendanMorley