Opened 11 years ago

Last modified 10 years ago

#5205 closed defect

Reading empty MTK GML files returns None — at Initial Version

Reported by: tpikonen Owned by: warmerdam
Priority: normal Milestone: 1.11.0
Component: OGR_SF Version: svn-trunk
Severity: normal Keywords: MTK GML
Cc:

Description

Trying to read an MTK GML file which does not have any actual data, just container tags with python-ogr results in a NoneType object:

from osgeo import ogr ff = ogr.Open('/tmp/K23441.xml') type(ff) -> NoneType

The file in question is part of the official Finnish land survey database and can be downloaded e.g. here: http://kartat.kapsi.fi/files/maastotietokanta/kaikki/etrs89/gml/K2/K23/K23441_mtk.zip

This feature makes some conversion scripts (like ogr2osm) fail, so it would be nice to get an empty osgeo.ogr.DataSource object from empty containers, if possible.

Non-empty files work fine with the MTK GML driver, so thanks for that!

Change History (0)

Note: See TracTickets for help on using tickets.