Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

#5205 closed defect (fixed)

Reading empty MTK GML files returns None

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

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')
-> NoneType

The file in question is part of the official Finnish land survey database and can be downloaded e.g. here:

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

comment:1 by tpikonen, 11 years ago

Description: modified (diff)

comment:2 by Even Rouault, 11 years ago

Component: defaultOGR_SF
Milestone: 2.0
Resolution: fixed
Status: newclosed

trunk r26339 "GML: open successfully GML datasources with 0 layers (#249, #5205)"

comment:3 by Even Rouault, 10 years ago

Note: See TracTickets for help on using tickets.