[gdal-dev] kml file does not open with ogrinfo but works with GE
Even Rouault
even.rouault at mines-paris.org
Thu Jan 3 12:23:43 PST 2013
Le jeudi 03 janvier 2013 13:08:28, Roger Bivand a écrit :
> If you change utf-16 in the first line to utf-8, then change line 2:
The encoding specification is indeed incorrect (UTF-16 is a 2-byte encoding,
and the file is really ASCII / UTF-8) --> the software that generated that file
should be fixed. No XML parser should accept that. Expat refuses it, libxml2
refuses it. libkml (developed by Google) also refuses it (it uses expat
underneath). Not sure what GoogleEarth uses it, but must be some custom XML
parser.
>
> <Document xmlns:gx="http://www.google.com/kml/ext/2.2"
> xmlns="http://www.opengis.net/kml/2.2">
>
> to
>
> <kml xmlns="http://www.opengis.net/kml/2.2">
>
> and the final line from </Document> to </kml> to match, gdalinfo recognises
> the file.
I've just made a tiny change in the KML driver to recognize a KML document
with <Document> as the root node. The LIBKML driver (based on Google libkml)
already recognized the file (once the encoding declaration changed of course).
More information about the gdal-dev
mailing list