bashcsvkmlgdalogr2ogr

gdal ogr2ogr produces empty files when converting kml files


I am trying to covert a bunch of .kml files using gdal ogr2ogr on terminal on a machine running Mac OS 10.12.

There is no error message, but the output files are empty. .kml files are google location history downloads.

The code I am using is:

ogr2ogr -f CSV output1.csv 5209.kml

I have also tried other formats with the same luck.

ogr2ogr -f GeoJSON geojson.json 5209.kml
ogr2ogr -f "ESRI Shapefile" points.shp 5209.kml 

Solution

  • This will work:

    ogr2ogr -f GeoJSON --config GDAL_SKIP GML geojson.json 5209.kml
    

    See the reason here