Hi Tom,

I tries adding my wfs view to QGIS using the WFS plugin, i tried these URL's:

http://localhost/openlayers/wfs
http://localhost/openlayers/wfs?SERVICE=wfs&VERSION=1.1.0&request=GetCap...

(where /openlayers/wfs is the path to my view)

QGIS doesnt give me an error, nor a list of layers to choose from (which i think is the default behaviour)

(and in the wfs-getcapabilities.tpl.php file, you need to use the print xml trick, too:

*/
  print "<?xml"; ?> version="1.0" encoding="utf-8" <?php print "?>";
?>

else the page won't render. too minor to create a separate issue, and i did fix this before trying the above.

)

Comments

batje’s picture

ok, i installed geoserver and dug into the code and stuff seems to halt at the describefeaturetype processing. I am more patient than brave.

tmcw’s picture

I'm not sure if QGIS supports WFS 1.1.0 fully. I'll look into it more - focus moved from QGIS in early testing to GeoServer and OpenLayers support, and therefore QGIS fell out of compatibility. Unfortunately QGIS isn't giving any feedback when run from terminal and loading WFS layers.

What's the problem with GeoServer, in detail?

batje’s picture

Sorry, skipped a version.

I am getting slightly further. In the current dev-release, renaming

wfs-describefeaturetype.tpl.php
to
wfs-describefeaturetype-geometry.tpl.php

helped me a great deal.

Will post more if i find it.

batje’s picture

OK, next finding was that my wkt fields had POLYGON(a,b,c,d) wrapped in GEOCOLLECTION(). That doesn't work real well. (here, it works really well in Openlayers 6.x-2.0-alpha7 ).

The parse_wkt funtion looks like regexp magic to me, i guess a bit of regexp love would solve this issue.

My polygons now look like

< gml:Point srsName="http://www.opengis.net/gml/srs/epsg.xml#4326" >
< gml:coordinates decimal="." cs="," ts=" ">32.28316111,1.11730914< /gml:coordinates >
< /gml:Point >

in the gml that geoserver spits out. Even thought the 'Default Style' is set to polygon in geoserver. In the list of layers, the 'dot' icon shows, and the gml confirms this.

Geoserver also does not find the Bounding Box, though I selected the -90 90, -180 180 one that the wfs module publishes as a default.

< gml:boundedBy >
< gml:null>unknown
< /gml:boundedBy >

Getting there. Slowly.

tmcw’s picture

The parse_wkt funtion looks like regexp magic to me, i guess a bit of regexp love would solve this issue.

Basically, yes - but it's a port of the OpenLayers WKT parser, rather than a reimplementation here. I basically just need to complete it for more WKT types to be supported.

strk’s picture

QGIS only supports WFS 1.0 at time of writing.
Lack of support for exceptions makes it less obvioius, see http://trac.osgeo.org/qgis/ticket/2891

I think the WFS drupal plugin README.txt file should be updated to reflect this, as it currently mentions support for QGIS too...

Switching to WFS 1.0 would likely add support for a few more clients.

As per WKT parsing, see http://drupal.org/node/821720
that code supports both GML2 (for WFS-1.0) and GML3 (for WFS-1.1)