Bug report #4995

Empty KML file products 'not a valid or recognized data source'

Added by Oliver Snowden over 9 years ago. Updated over 9 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:-
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:14776

Description

The attached KML code validates at http://kmlvalidator.com/. Clearly the file does not contain any geometries but a user probably doesn't know this. In Google Earth the file is added correctly (albeit without any points etc.).

empty.kml (1.95 KB) Oliver Snowden, 2012-02-13 04:13 AM

History

#1 Updated by Oliver Snowden over 9 years ago

Empty KML file produces 'not a valid or recognized data source'

#2 Updated by Giovanni Manghi over 9 years ago

  • Status changed from Open to Feedback

can you read/translate the same kml file directly using the OGR library?

#3 Updated by Oliver Snowden over 9 years ago

It appears that we cannot access this file from ogr2ogr:

$ ogr2ogr -f "KML" -s_srs "EPSG:4326" empty_test.kml -t_srs "EPSG:4326" empty.kml
ERROR 4: No layers in KML file: empty.kml.
FAILURE:
Unable to open datasource `empty.kml' with the following drivers.
-> ESRI Shapefile
-> MapInfo File
...

Whereas a file with data in returns a result such as:
$ ogr2ogr -f "KML" -s_srs "EPSG:4326" empty_test.kml -t_srs "EPSG:4326" test.kml
Warning 1: Layer name 'Layer #0' adjusted to 'Layer__0' for XML validity.

#4 Updated by Giovanni Manghi over 9 years ago

  • Status changed from Feedback to Closed
  • Resolution set to invalid

Hi,

then is a OGR issue, not a QGIS one.

#5 Updated by Oliver Snowden over 9 years ago

Thanks, I take you point. Obviously it would be nice if there was a mechanism to push this upstream.

Agreed that this particular issue is very minor. End users, unfortunately, view these problems as issues with QGIS and is quite damaging to their impression of the software. Whilst changes are just a commit away, the sorts of end users I come across would only be able to provide relatively small monetary donations. Perhaps this could be food for thought in the future as I see you have bounties on other issues.

#6 Updated by Giovanni Manghi over 9 years ago

Oliver Snowden wrote:

Thanks, I take you point. Obviously it would be nice if there was a mechanism to push this upstream.

there is, the GDAL/OGR bug tracker

http://trac.osgeo.org/gdal/

Agreed that this particular issue is very minor. End users, unfortunately, view these problems as issues with QGIS and is quite damaging to their impression of the software. Whilst changes are just a commit away, the sorts of end users I come across would only be able to provide relatively small monetary donations. Perhaps this could be food for thought in the future as I see you have bounties on other issues.

You are right, but in this particular case I think (I may be wrong) that there is not much to do if not report the issue upstream, check if eventually is fixed in a recent release of gdal like the 1.9 (or trunk) and/or push/support the fixing of such bug.

#7 Updated by Alexander Bruy over 9 years ago

Confirmed with GDAL 1.9.0. Submitted to GDAL bugtracker http://trac.osgeo.org/gdal/ticket/4511

Also available in: Atom PDF