[gdal-dev] Reading KMZ in Ogr Csharp

Even Rouault even.rouault at spatialys.com
Thu Apr 6 09:52:08 PDT 2017

On jeudi 6 avril 2017 04:25:37 CEST keith at speerit.nl wrote:
> 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?

No workaround that I can think of, apart from applying the fix I've just done in https://


Spatialys - Geospatial professional services
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20170406/4cbfb590/attachment-0001.html>

More information about the gdal-dev mailing list