[gdal-dev] Reading KMZ in Ogr Csharp

keith at speerit.nl keith at speerit.nl
Thu Apr 6 04:25:37 PDT 2017


Hello,

We’re using the gdal ogr csharp library to read kmz files (such as the
attached file), using the libkml driver. The code used to open the file:

OSGeo.OGR.Ogr.RegisterAll();
OSGeo.OGR.Ogr.Open(/*path to file*/, 0);

When trying to open the file, I get an error: Error parsing kml Style: No
id. When using other methods to open the file such as ogrinfo and ogr2ogr)
the same error is shown, but I can still read data from the file. When
opening the file in Google earth, the error is just ignored and my file is
displayed correctly. So I would expect the same to be possible when using
the csharp library. I tried using the Ogr.DonUseExceptions method, but this
also doesn’t help.

A style not having an ID isn’t very logical as it can’t be used. However, I
wouldn’t expect it to not do anything with the file. We receive files from
our clients and then read information from the files so it’s impossible to
check all files for these kind of errors and then fix them, especially when
they generate large files.

Is there possibly  a flag I can set to ignore style errors? Or is there
another workaround for this? If no, is it possible to implement such a
feature? 

Cheers,
Keith
testfile_nostyle.kmz
<http://osgeo-org.1560.x6.nabble.com/file/n5316108/testfile_nostyle.kmz>  



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Reading-KMZ-in-Ogr-Csharp-tp5316108.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.


More information about the gdal-dev mailing list