2

QGIS 2.18.5

I've done this in the past but I can't remember how I did it! I'm saving a point layer as a kml and trying to bring over the attribute data across with the kml. I've got some screenshots of the result from the past:

enter image description here enter image description here

I've read a post about exporting 2 attributes but obviously I managed to export a selection of my attributes. I'm not an experienced coder and there weren't any intricate expressions involved. I remember filling in the 'Description Field' and 'NameField' shown below but from recollection, that only changed what the pins in Google Earth are titled with - shown as parcel numbers in my case.

enter image description here

2

I can't believe I missed this....when saving the vector layer as a .kml, there is a inconspicuous drop down arrow which says "select fields to export and their export options". Problem solved!

  • Interesting... and well hidden. It also allow using the name/description fields! In Google Earth though, it seems to display either the description or the data table but not both – JGH May 26 '17 at 9:20
1

The output you got is from the OGR tool:

Processing menu -> Toolbox -> GDAL/OGR -> Conversion -> convert format

Trying it with a polygon layer, the output KML displayed in Google Earth shows no name and empty description, but clicking on an item brings the attribute table.

  • Thanks! I managed to do this once and got point attribute data into a set of pins in google earth. Now when I try to convert any other shapefile the process completes and the dialogue box auto-closes - but there is no kml saving to my destination. No error either. – James B May 25 '17 at 11:45
  • Make sure the KML file extension is also selected, as it defaults to shapefiles (even if you have selected the kml format). Otherwise try the command line version as you control all parameters – JGH May 25 '17 at 12:20
  • Afraid that doesn't seem to fix the issue. The command line version seems very daunting to me. Is that something you plug into python? – James B May 26 '17 at 8:25
  • I can't believe I missed this....when saving the vector layer as a .kml, there is a inconspicuous drop down arrow which says "select fields to export and their export options". Problem solved! – James B May 26 '17 at 8:53
  • You could just run it in windows command prompt: "C:\Program Files\QGIS 2.18\bin\ogr2ogr.exe" -f KML "C:/output.kml" "C:/source.shp" layername – JGH May 26 '17 at 9:08

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.