I am working on a free/open source workflow to ingest OSM data and convert it to a KML so I can view it in 3D with Google Earth.

I used ogr2ogr to convert to a shapefile and have extracted the height values into their own field in the file. I now want to use ogr2ogr to convert to KML. I understand that I need to use the LIBKML library and extrude on my height field, but while I try to do this I repeatedly get flat KML output. I tried to look through the GDAL documentation, but there is little info on how to extrude height from a field so it shows up in the resulting KML.

This is the command I attempted:

ogr2ogr -f libkml "E:/filepath.kml" "E:/filepath.shp" -zfield "height" -t_srs "EPSG:4326"

I would really like to use ogr2ogr to solve this, but if there's another open source library I'm open to that too.

  • A small clever tool called shp2kml used to do that: zonums.com/shp2kml.html – Tamas Kosa Mar 4 '16 at 10:03
  • I'm unable to get this tool working.. says it has an expired license and the most recent version is from 2007. I appreciate the suggestion but I really need to find something that will work and receives a bit more in terms of support/updates. Can anyone maybe help me with the command in my question? I think I could be formatting incorrectly or not setting an extrusion variable before running it? – tharner92 Mar 5 '16 at 15:32
  • I used to use this tool many of times, but you're right it's bot working anymore... :( – Tamas Kosa Mar 7 '16 at 10:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.