Opened 17 years ago

Closed 15 years ago

#1835 closed enhancement (fixed)

KML Driver - kml without placemearks gives misleading return error

Reported by: darkblueB Owned by: Mateusz Łoskot
Priority: normal Milestone:
Component: OGR_SF Version: svn-trunk
Severity: normal Keywords: kml
Cc: warmerdam, Didge, Kyle Shannon, springmeyer

Description

Open a kml file with only NetworkLinks instead of Placemarks (common situation) ogrinfo and ogr2ogr return the error associated with a bad input file "Unable to open file with the following drivers ..."

Actually, the file was opened just fine, and was parsed just fine, but the tags in the KML were not handled. Because there was no Placemark, the error percolates back up in such a way as to generate a misleading error msg

Attachments (2)

UNEP_geoData.kml (21.3 KB ) - added by darkblueB 17 years ago.
empty.kml (154 bytes ) - added by Even Rouault 17 years ago.
KML file with no content

Download all attachments as: .zip

Change History (7)

by darkblueB, 17 years ago

Attachment: UNEP_geoData.kml added

comment:1 by warmerdam, 17 years ago

Cc: warmerdam Didge added
Owner: changed from warmerdam to Mateusz Łoskot
Version: unspecifiedsvn-trunk

Mateusz or Jens, please review, command and act as appropriate.

by Even Rouault, 17 years ago

Attachment: empty.kml added

KML file with no content

comment:2 by Even Rouault, 17 years ago

In fact, it doesn't fail silently but with the following message :

"ERROR 4: No layers in KML file: `../../cropcircletk.kml'. FAILURE: nable to open datasource `../../cropcircletk.kml' with the following drivers.

-> ESRI Shapefile -> MapInfo File -> UK .NTF -> SDTS -> TIGER -> S57 -> DGN -> VRT -> AVCBin -> REC -> Memory -> BNA -> CSV -> GML -> KML -> GMT -> ODBC -> PGeo -> OGDI -> PostgreSQL

"

The question is : do other OGR drivers fail when they parse empty content / what are they supposed to do in such a situation ? (The BNA driver doesn't fail.)

comment:3 by Kyle Shannon, 16 years ago

Cc: Kyle Shannon added

comment:4 by springmeyer, 16 years ago

Cc: springmeyer added

Seems like a special case of error reporting would be very useful here.

comment:5 by Even Rouault, 15 years ago

Resolution: fixed
Status: newclosed

This was solved in 1.5.0. The following error is now reported : "ERROR 4: No layers in KML file: UNEP_geoData.kml."

Note: See TracTickets for help on using tickets.