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 Answers 2

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!

1
  • 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
    Commented May 26, 2017 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.

5
  • 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
    Commented May 25, 2017 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
    Commented May 25, 2017 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
    Commented May 26, 2017 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
    Commented May 26, 2017 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
    Commented May 26, 2017 at 9:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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