Bug report #15061

Cannot add WFS layer

Added by dr - over 8 years ago. Updated about 7 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Unknown
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:23004

Description

I've made local WFS using MapServer, but when trying add it to QGIS get an error:

Analysis of DescribeFeatureType response failed for url  srsname='EPSG:3857' typename='railway_station' url='http://127.0.0.1/cgi-bin/mapserv?map=/var/www/wfs.map&' version='1.1.0' table="" sql=: it is probably a schema for Complex Features

Associated revisions

Revision f3549981
Added by Even Rouault over 8 years ago

[WFS provider] Add heuristics to detect MapServer WFS 1.1 behaviour (sometimes)

Fix #15061

MapServer honours EPSG axis order in WFS 1.1, but returns srsName in GetFeature
response with EPSG:XXXX syntax instead of urn EPSG srs. This confuses the GML
parser that thinks that no axis inversion should then happen.

The heuristics here consist in checking the envelope of the response with the
capabilities extent.

This should be safe and should work for layers with non global extent, but will
not detect all issues.

Proper fix is either to force WFS 1.0, or upgrade to MapServer 7.0 with WFS 2.0

History

#1 Updated by Even Rouault over 8 years ago

Could you paste the output of "http://127.0.0.1/cgi-bin/mapserv?map=/var/www/wfs.map&REQUEST=DescribeFeatureType&SERVICE=WFS&VERSION=1.1.0&TYPENAME=railway_station" ?

#2 Updated by dr - over 8 years ago

My fault. I had incorrect dbname in mapfile.

<schema xmlns:ms="http://mapserver.gis.umn.edu/mapserver" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" targetNamespace="http://mapserver.gis.umn.edu/mapserver" elementFormDefault="qualified" version="0.1">
<import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/3.1.1/base/gml.xsd"/>
<!--  ERROR: Failed opening layer railway_station  -->
</schema>

I've fixed dbname. But there are no features on canvas and each attribute value is ERROR. If open this URL in browser "http://127.0.0.1/cgi-bin/mapserv?map=/var/www/wfs.map&REQUEST=GetFeature&SERVICE=WFS&VERSION=1.1.0&TYPENAME=railway_station&MaxFeatures=1" then I see all attributes are correct:


<?xml version='1.0' encoding="utf-8" ?>
<wfs:FeatureCollection
   xmlns:ms="http://mapserver.gis.umn.edu/mapserver" 
   xmlns:gml="http://www.opengis.net/gml" 
   xmlns:wfs="http://www.opengis.net/wfs" 
   xmlns:ogc="http://www.opengis.net/ogc" 
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
   xsi:schemaLocation="http://mapserver.gis.umn.edu/mapserver http://127.0.0.1/cgi-bin/mapserv?map=/var/www/wfs.map&amp;SERVICE=WFS&amp;VERSION=1.1.0&amp;REQUEST=DescribeFeatureType&amp;TYPENAME=railway_station&amp;OUTPUTFORMAT=text/xml;%20subtype=gml/3.1.1  http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
      <gml:boundedBy>
          <gml:Envelope srsName="EPSG:4326">
              <gml:lowerCorner>55.429641 36.840171</gml:lowerCorner>
              <gml:upperCorner>55.429641 36.840171</gml:upperCorner>
          </gml:Envelope>
      </gml:boundedBy>
    <gml:featureMember>
      <ms:railway_station gml:id="railway_station.1">
        <gml:boundedBy>
            <gml:Envelope srsName="EPSG:4326">
                <gml:lowerCorner>55.429641 36.840171</gml:lowerCorner>
                <gml:upperCorner>55.429641 36.840171</gml:upperCorner>
            </gml:Envelope>
        </gml:boundedBy>
        <ms:msGeometry>
          <gml:Point srsName="EPSG:4326">
            <gml:pos>55.429641 36.840171</gml:pos>
          </gml:Point>
        </ms:msGeometry>
        <ms:ogc_fid>1</ms:ogc_fid>
        <ms:osm_id>255593178</ms:osm_id>
        <ms:name>Бекасово I</ms:name>
        <ms:railway>station</ms:railway>
        <ms:webmercator>0101000020110F0000631E368BD2494F415700AB4F31675C41</ms:webmercator>
      </ms:railway_station>
    </gml:featureMember>
</wfs:FeatureCollection>

#3 Updated by dr - over 8 years ago

I see log message:

2016-06-18T14:15:51    1    Cannot create temporary SpatiaLite cache

#4 Updated by Even Rouault over 8 years ago

  • Status changed from Open to Closed

#5 Updated by Jürgen Fischer about 7 years ago

  • Category set to Unknown

Also available in: Atom PDF