[Qgis-developer] QGIS Server WFS-T integration

Marco Hugentobler marco.hugentobler at sourcepole.ch
Sat Oct 6 08:56:12 PDT 2012


Hi René-Luc

Below is the capabilities response I get. There is a transaction element 
in it (so I guess publishing the layer as WFS-T worked). But the WFS 
client in QGIS does not seem to recognize it.

Regards,
Marco


<WFS_Capabilities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:ogc="http://www.opengis.net/ogc" version="1.0.0" 
xmlns="http://www.opengis.net/wfs" updateSequence="0" 
xmlns:xlink="http://www.w3.org/1999/xlink" 
xsi:schemaLocation="http://www.opengis.net/wfs 
http://schemas.opengis.net/wfs/1.0.0/wfs.xsd" 
xmlns:gml="http://www.opengis.net/gml" 
xmlns:ows="http://www.opengis.net/ows">
  <Service>
   <Name>WMS</Name>
   <!-- Human-readable title for pick lists -->
   <Title>QGIS mapserver</Title>
   <!-- Narrative description providing additional information -->
   <Abstract>A WMS service with QGIS mapserver</Abstract>
   <KeywordList>
    <Keyword>QGIS mapserver</Keyword>
   </KeywordList>
   <!-- Top-level web address of service or service provider. See also 
OnlineResource
                      elements under <DCPType>. -->
   <OnlineResource xlink:type="simple" 
xmlns:xlink="http://www.w3.org/1999/xlink" 
xlink:href="http://www.sourcepole.ch/"/>
   <!-- Contact information -->
   <ContactInformation>
    <ContactPersonPrimary>
     <ContactPerson>Ionut Iosifescu</ContactPerson>
     <ContactOrganization>ETHZ</ContactOrganization>
    </ContactPersonPrimary>
    <ContactAddress>
     <AddressType>postal</AddressType>
     <Address>Wolfgang-Pauli-Strasse 15</Address>
     <City>Zurich</City>
     <StateOrProvince>ZH</StateOrProvince>
     <PostCode>8093</PostCode>
     <Country>SWITZERLAND</Country>
    </ContactAddress>
    <ContactVoiceTelephone>+41 44 633 30 28</ContactVoiceTelephone>
<ContactElectronicMailAddress>iosifescu at karto.baug.ethz.ch</ContactElectronicMailAddress>
   </ContactInformation>
   <!-- Fees or access constraints imposed. -->
   <Fees>none</Fees>
   <AccessConstraints>none</AccessConstraints>
   <LayerLimit>999</LayerLimit>
  </Service>
  <Capability>
   <Request>
    <GetCapabilities>
     <Format>text/xml</Format>
     <DCPType>
      <HTTP>
       <Get>
        <OnlineResource xlink:type="simple" 
xlink:href="http://localhost/cgi-bin/qgis_mapserv.fcgi?MAP=/home/marco/geodaten/projekte/a.qgs&"/>
       </Get>
      </HTTP>
     </DCPType>
    </GetCapabilities>
    <DescribeFeatureType>
     <SchemaDescriptionLanguage>
      <XMLSCHEMA/>
     </SchemaDescriptionLanguage>
     <DCPType>
      <HTTP>
       <Get>
        <OnlineResource xlink:type="simple" 
xlink:href="http://localhost/cgi-bin/qgis_mapserv.fcgi?MAP=/home/marco/geodaten/projekte/a.qgs&"/>
       </Get>
      </HTTP>
     </DCPType>
    </DescribeFeatureType>
    <GetFeature>
     <ResultFormat>
      <GML2/>
      <GeoJSON/>
     </ResultFormat>
     <DCPType>
      <HTTP>
       <Get>
        <OnlineResource xlink:type="simple" 
xlink:href="http://localhost/cgi-bin/qgis_mapserv.fcgi?MAP=/home/marco/geodaten/projekte/a.qgs&"/>
       </Get>
      </HTTP>
     </DCPType>
    </GetFeature>
    <Transaction>
     <DCPType>
      <HTTP>
       <Post>
        <OnlineResource xlink:type="simple" 
xlink:href="http://localhost/cgi-bin/qgis_mapserv.fcgi?MAP=/home/marco/geodaten/projekte/a.qgs&"/>
       </Post>
      </HTTP>
     </DCPType>
    </Transaction>
   </Request>
  </Capability>
  <FeatureTypeList>
   <Operations>
    <Query/>
   </Operations>
   <FeatureType>
    <Name>gem</Name>
    <Title>gem</Title>
    <Abstract></Abstract>
    <SRS>EPSG:21781</SRS>
    <LatLongBoundingBox maxx="716900" minx="665647" maxy="283339" 
miny="223895"/>
    <Operations>
     <Query/>
    </Operations>
   </FeatureType>
  </FeatureTypeList>
  <ogc:Filter_Capabilities>
   <ogc:Spatial_Capabilities>
    <ogc:Spatial_Operators>
     <ogc:BBOX/>
    </ogc:Spatial_Operators>
   </ogc:Spatial_Capabilities>
   <ogc:Scalar_Capabilities>
    <ogc:Comparison_Operators>
     <ogc:Simple_Comparisons/>
    </ogc:Comparison_Operators>
   </ogc:Scalar_Capabilities>
  </ogc:Filter_Capabilities>
</WFS_Capabilities>

On 06.10.2012 16:37, René-Luc D'Hont wrote:
>
> Do you have a wfstlayers element in the QGIS project file ?
> In this element I define the WFS-T capabilities. The server uses it to 
> define the layer capabilities. You can find its in the Query element 
> of your layer featuretype element.
>
> Le 6 oct. 2012 16:23, "Marco Hugentobler" 
> <marco.hugentobler at sourcepole.ch 
> <mailto:marco.hugentobler at sourcepole.ch>> a écrit :
>
>     Hi René-Luc
>
>     >If you want to test QGIS Server Transaction you need to use the
>     QGIS of my branch
>
>     I'm using the branch wfs_server_transaction from your repo. Adding
>     a WFS is possible, but QGIS does not show it as editable (the edit
>     tool is grayed out).
>
>     Regards,
>     Marco
>
>     On 03.10.2012 16:53, rldhont wrote:
>
>         Hi Marco,
>
>         I updated the QgsGeometry Class to add :
>         * fromGML2 static method
>         * exportToGML2 method
>
>         If you want to test QGIS Server Transaction you need to use
>         the QGIS of my branch, because I update the WFS provider to
>         POST transaction with a query_string (in the case of QGIS
>         Server the map parameter).
>
>         Regards,
>         René-Luc
>
>         Le 03/10/2012 11:44, Marco Hugentobler a écrit :
>
>             Hi René-Luc
>
>             >For the GML, I'll update QgsGeometry class ?
>
>             Yes, it will be good to have everything in one place (also
>             for a potential redesign of QgsGeometry). But the GML
>             methods should not be exported to the bindings, maybe you
>             could add a comment in that direction to qgsgeometry.h.
>
>             Regards,
>             Marco
>
>             On 03.10.2012 10:03, rldhont wrote:
>
>                 Hi Marco,
>
>                 I updated my branch with the definition of
>                 QGS_NAMESPACE and OGC_NAMESPACE.
>
>                 For the GML, I'll update QgsGeometry class ?
>
>                 For Query_String, I found the code with a google search.
>
>                 I test WFS-T with a jQuery XML POST and with QGIS.
>
>                 Cheers,
>                 René-Luc D'Hont
>                 3Liz
>
>                 Le 03/10/2012 09:26, Marco Hugentobler a écrit :
>
>                     Hi René-Luc
>
>                     Thank you for this nice addition, WFS-T will
>                     certainly be a great contribution to QGIS server!
>
>                     I tried to compile the wfs_server_transaction
>                     branch, but it fails with the following error
>                     message (QGS_NAMESPACE and OGC_NAMESPACE are not
>                     defined):
>
>                     /home/marco/src/Quantum-GIS/src/mapserver/qgswfsserver.cpp:718:35:
>                     Fehler: »QGS_NAMESPACE« wurde in diesem
>                     Gültigkeitsbereich nicht definiert
>                     /home/marco/src/Quantum-GIS/src/mapserver/qgswfsserver.cpp:721:39:
>                     Fehler: »OGC_NAMESPACE« wurde in diesem
>                     Gültigkeitsbereich nicht definiert
>
>
>                     Maybe there is a commit that you did not push to
>                     github yet?
>
>                     Then, looking at qgswfsserver.cpp, it seems that
>                     most of the 2000 code lines deal with GML. It
>                     would be good to separate that into a GML handling
>                     class on its own (which could also be used from
>                     qgswfsprovider, at the moment, the gml reading
>                     seems to be duplicated).
>
>                     In QgsPostRequestHandler, the code looks for the
>                     environment variable QUERY_STRING. I thought
>                     QUERY_STRING is only defined in http get requests
>                     and in post requests, there is only CONTENT_LENGTH ?
>
>                     Which WFS client did you use for testing (QGIS
>                     desktop)?
>
>                     Regards,
>                     Marco
>
>
>
>
>                     On 01.10.2012 15:21, rldhont wrote:
>
>                         Hi all,
>
>                         I need some review for the WFS-T
>                         implementation in QGIS-Server.
>                         https://github.com/rldhont/Quantum-GIS/tree/wfs_server_transaction
>                         This branche adds the capability to the QGIS
>                         Server to understand transaction, adds a way
>                         to define which WFS layer can be editable and
>                         if the administrator authorize insert and
>                         delete, adds an enhancements for the WFS
>                         provider to support WFS-T which needs extra
>                         parameters.
>
>                         For the configuration on the WFS-T part,
>                         Update is possible if the layer is publish as
>                         a WFS layer, Insert is possible only if Update
>                         is possible and Delete is possible only if
>                         Insert is possible. You can check Delete on a
>                         layer and it's automatically a WFS layer, or
>                         uncheck Publied on a layer and all the
>                         checkbox are unchecked.
>
>                         I have testing QGIS-Server transaction with an
>                         ESRI ShapeFile and a Spatialite database. The
>                         both doesn't return a good FID, but only
>                         Spatialite has persistent FID. The Spatialite
>                         provider probably needs an update.
>                         I test my QGIS-Server with QGIS and some
>                         JavaScript code.
>
>                         René-Luc D'Hont
>                         3Liz
>                         _______________________________________________
>                         Qgis-developer mailing list
>                         Qgis-developer at lists.osgeo.org
>                         <mailto:Qgis-developer at lists.osgeo.org>
>                         http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
>                     _______________________________________________
>                     Qgis-developer mailing list
>                     Qgis-developer at lists.osgeo.org
>                     <mailto:Qgis-developer at lists.osgeo.org>
>                     http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
>
>
>
>         _______________________________________________
>         Qgis-developer mailing list
>         Qgis-developer at lists.osgeo.org
>         <mailto:Qgis-developer at lists.osgeo.org>
>         http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
>
>     -- 
>     Dr. Marco Hugentobler
>     Sourcepole -  Linux & Open Source Solutions
>     Weberstrasse 5, CH-8004 Zürich, Switzerland
>     marco.hugentobler at sourcepole.ch
>     <mailto:marco.hugentobler at sourcepole.ch> http://www.sourcepole.ch
>     Technical Advisor QGIS Project Steering Committee
>
>     _______________________________________________
>     Qgis-developer mailing list
>     Qgis-developer at lists.osgeo.org <mailto:Qgis-developer at lists.osgeo.org>
>     http://lists.osgeo.org/mailman/listinfo/qgis-developer
>


-- 
Dr. Marco Hugentobler
Sourcepole -  Linux & Open Source Solutions
Weberstrasse 5, CH-8004 Zürich, Switzerland
marco.hugentobler at sourcepole.ch http://www.sourcepole.ch
Technical Advisor QGIS Project Steering Committee

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20121006/1cec816f/attachment-0001.html>


More information about the Qgis-developer mailing list