Opened 11 years ago

Last modified 10 years ago

#5205 closed defect

Reading empty MTK GML files returns None — at Version 1

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 (last modified by tpikonen)

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 (1)

comment:1 by tpikonen, 11 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.