[Qgis-user] Cannot open GML files in Qgis 2.6 under Windows

Even Rouault even.rouault at spatialys.com
Thu Dec 4 08:32:22 PST 2014


Le jeudi 04 décembre 2014 17:00:56, Andre Joost a écrit :
> Am 04.12.2014 um 13:23 schrieb Richard Duivenvoorde:
> > I tried it with this GML:
> > 
> > https://downloadagiv.blob.core.windows.net/overstromingsgebieden-en-oever
> > zones/2014_01/Overstromingsgebieden_en_oeverzones_2014_01_GML.zip
> > 
> > And indeed only get tables and no geometries...
> > 
> > BUT if I use ogr to open them:
> > 
> > ogrinfo -al Ogoz.gml
> > 
> > OGRFeature(Ogoz):15
> > 
> >    UIDN (Real) = 16
> >    OIDN (Real) = 16
> >    CODOGOZ (Integer) = 16
> >    NAAMOGOZ (String) = OG Puttenbeek
> >    NUMAC (Real) = 2014035191
> >    ININMRID (String) = 20001
> >    ININMR (String) = Provincie Vlaams-Brabant
> >    OPPERVL (Real) = 17031.46
> >    LENGTE (Real) = 969.01
> >    POLYGON ((138955.079 183000.758,138911.506 182970.395,138897.621
> >    ... truncated ...
> >    183007.847,138961.648 183005.335,138955.079 183000.758))
> 
> The GDAL that comes with QGIS 2.6.1 standalone reports for the same file
> for me:
> 
> Had to open data source read-only.
> INFO: Open of `ogoz.gml'
>        using driver `GML' successful.
> 
> Layer name: Ogoz
> Geometry: None
> Feature Count: 17
> Layer SRS WKT:
> (unknown)
> ...
> 
> OGRFeature(Ogoz):15
>    UIDN (Real) = 16
>    OIDN (Real) = 16
>    CODOGOZ (Integer) = 16
>    NAAMOGOZ (String) = OG Puttenbeek
>    NUMAC (Real) = 2014035191
>    ININMRID (String) = 20001
>    ININMR (String) = Provincie Vlaams-Brabant
>    OPPERVL (Real) = 17031.46
>    LENGTE (Real) = 969.01
> ...
> 
> So your version can read the geometry, mine not? The gisinternals-SDK of
> gdal-1.11.1 and gdal-dev report the same.
> 
> Converting to spatialite database works quickly, but no geometry in
> there either.
> 
> > Dev's? Any idea about this?
> > Should we open an issue?
> 
> Should go for the GDAL bug tracker, I think.

I've analyzed the issue. The problem is that the XSD parser of the OGR GML 
driver couldn't recognize the following construct found in Ogoz.xsd :
        <xs:choice>
            <xs:element ref="gml:polygonProperty"/>
            <xs:element ref="gml:multiPolygonProperty"/>
        </xs:choice>
And thus it marked the layer as having no geometry. I've just improved that in 
GDAL trunk.

The fact that it worked for some people is if you read the .gml without having 
the .xsd next to it. In that case, a different code path is taken in the driver 
to do a first full scan of the file to discover its schema.

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com



More information about the Qgis-user mailing list