[gdal-dev] OSM to KML Error

Even Rouault even.rouault at mines-paris.org
Wed Jul 3 05:12:58 PDT 2013


> 
> Hello Even
> Thank you very much for your help, now it works! Probably I have not fully
> understood the problem, but is it something that can and will be fixed in
> a future version? Josua

Probably not. This is not really a bug, but a consequence of how the KML 
writer works. It writes features in the files as soon as they arrive. To handle 
layer interleaved writing, it should keep them all in memory before flushing 
them to disk, which might cause memory issues when writing huge KML files.

Note that if you have a build of GDAL/OGR with the LIBKML driver, you could 
use it directly (ogr2ogr -f LIBKML), as it indeed stores all features into 
memory. If you work with really big OSM files whose content cannot fit entirely 
in memory, this will not work.

Otherwise, if your OSM file is small enough so that no OSM layer has more than 
100 000 features, you can try adding "--config OGR_INTERLEAVED_READING NO" to 
your ogr2ogr command line. This will instruct ogr2ogr and the OSM driver not 
to go to interleaved reading mode, but as soon as a layer will have more than 
100 000 features, the reading will stop.

-- 
Geospatial professional services
http://even.rouault.free.fr/services.html


More information about the gdal-dev mailing list