Bug report #15061

Cannot add WFS layer

Added by dr - over 5 years ago. Updated about 4 years ago.

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


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='' version='1.1.0' table="" sql=: it is probably a schema for Complex Features

Associated revisions

Revision f3549981
Added by Even Rouault over 5 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


#1 Updated by Even Rouault over 5 years ago

Could you paste the output of "" ?

#2 Updated by dr - over 5 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  -->

I've fixed dbname. But there are no features on canvas and each attribute value is ERROR. If open this URL in browser "" then I see all attributes are correct:

<?xml version='1.0' encoding="utf-8" ?>
   xsi:schemaLocation="http://mapserver.gis.umn.edu/mapserver;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:Envelope srsName="EPSG:4326">
              <gml:lowerCorner>55.429641 36.840171</gml:lowerCorner>
              <gml:upperCorner>55.429641 36.840171</gml:upperCorner>
      <ms:railway_station gml:id="railway_station.1">
            <gml:Envelope srsName="EPSG:4326">
                <gml:lowerCorner>55.429641 36.840171</gml:lowerCorner>
                <gml:upperCorner>55.429641 36.840171</gml:upperCorner>
          <gml:Point srsName="EPSG:4326">
            <gml:pos>55.429641 36.840171</gml:pos>
        <ms:name>Бекасово I</ms:name>

#3 Updated by dr - over 5 years ago

I see log message:

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

#4 Updated by Even Rouault over 5 years ago

  • Status changed from Open to Closed

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

  • Category set to Unknown

Also available in: Atom PDF