[Qgis-user] Exporting QGIS map to KML/KMZ

Richard McDonnell richard.mcdonnell at opw.ie
Fri Aug 13 07:50:43 PDT 2021


Hi,
You can do this, but it requires a few steps. Open up the Project where the Layers are and they are all styled as you want

STEP1 Convert all to KMZ

1.       In the Processing Tools under GDAL, Vector Conversion highlight Convert format right click and select Execute as Batch Process

2.       Click the + symbol to add additional rows and select the Layers you want to convert

3.       Click on the three dots on the right for the first layer, set the Save as type to KML set a location and in the file name we are just going to give it a prefix, type something like 01_ then click save

4.       You will then be presented with the AutoFill option, set the Autofill mode to Fill with parameter values and set the Parameter to use to Input Layer, at this stage you can delete the prefix manually if you wish

5.       Click Run
This should have saved out all Shapefiles as KML’s for you. Now for the Styling and fixing of styles

STEP2 Apply Styles to KML

1.       Right click on one of the original Layers in your project, select Styles, Copy Style, All Style Categories

2.       Right click on the corresponding KML select Styles, Paste Style, All Style Categories
Repeat for all other Layers

STEP3 Final Step

1.       In the Search baron the Processing Toolbox search for Package Layers

2.       Select the KML Files as your Input Layers

3.       Make sure the Save layer Styles into GeoPackage

4.       Click on the three dots at Destination GeoPackage, selecting Save to File, set the Location and Name of the GeoPackage, click Save and then click Run

The result will be a GeoPackage file with the KML’s saved and the Styles applied, which means that anyone who opens the GeoPackage in another QGIS Project will always have the Styles applied.

I don’t believe there is an automated process that will do this for you, but you could also look at the model builder and using the steps above as a guide, build a custom process which will do the three steps I have outlined above in a single step for you.
Hope that helps,

Richard McDonnell





——
Richard McDonnell MSc GIS, FME Certified Professional
FRM Data Management

——
Oifig na nOibreacha Poiblí
Office of Public Works

Sráid Jonathan Swift, Baile Átha Troim, Co na Mí, C15 NX36
Jonathan Swift Street, Trim, Co Meath, C15 NX36
——
M +353 87 688 5964 T +353 46 942 2409
https://gov.ie/opw

——
To send me files larger than 30MB, please use the link below https://filetransfer.opw.ie/filedrop/richard.mcdonnell@opw.ie

Email Disclaimer: https://www.gov.ie/en/organisation-information/439daf-email-disclaimer/
From: Qgis-user <qgis-user-bounces at lists.osgeo.org> On Behalf Of krishna Ayyala
Sent: 13 August 2021 14:06
To: qgis-user <qgis-user at lists.osgeo.org>
Subject: [Qgis-user] Exporting QGIS map to KML/KMZ

Hello,
I am reposting this question. I have a QGIS map saved with ".qgz" extension. This map has four layers. One layer has points, one layer has lines and two layers have polygons. Is it possible to convert the entire map to kmz without losing the symbology. I know how to convert each layer into kmz. But, I am exploring to see if I can convert the entire map to kmz?

Regards.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20210813/1ae3af02/attachment.html>


More information about the Qgis-user mailing list