I am trying to export styled points from QGIS to KML/KMZ format. The points are styled according to an attribute value ("Subsidence"). I want to export the KML/KMZ with the symbology, but when I open the result in Google Earth, it isn't preserved. Can someone help me understand why and if there is a way to accomplish this?
3 Answers
QGIS styling is not directly exported in KML. You can, however, construct a style string in a special attribute called OGR_STYLE
for each feature, and that will be interpreted if you export with the libkml
driver. More details at Styling KML through LIBKML layer creation options
-
A few years later, but let's try: I followed this post of yours Styling KML through LIBKML layer creation options related to this question. However, it doesn't work with Point geometry. Are you familiar with an
OGR2OGR
conversion or QGIS export option to utilize theOGR_STYLE
field to symbolize points? Note that I testedOGR2OGR data_out.kml data_in.shp
with Line geometry, and it worked. Thanks. Commented May 13 at 19:15
Styling is QGIS-specific and thus you can't just export it and see it in the same shape, color, size etc. in any other application (or only if it has a rendering that matches the one that is implemented in QGIS). Style is not standardized, but program-specific. The yellow markers of Goolge Earth will not be shown the same way in QGIS either (if you do the export the other way round).
I managed to solve this by splitting the vector layer into multiple vector layers based on the value I used to style the points. Then, I gave each file a single point style based on the value. After doing this I ended up with many vector files (one for each value) which I then merged in Google Earth Pro.