What is a KMZ file? How to open one, KML vs KMZ, and the KMZ a DJI drone flies
A KMZ file is a map file: a KML file packed in a ZIP archive, often with the images or 3D models it uses. Google Earth, Google My Maps and most GIS programs open it.
By Sander Helgesen · Last checked
In short
- KML (Keyhole Markup Language) is a text format for map data: points, lines, areas, labels and styles. Google submitted it to the OGC, where KML 2.2 and 2.3 are standards.
- A KMZ is one KML file zipped together with any files it points to. Google's documentation names the main file
doc.kmlby default and allows only one.kmlfile in the archive, at the top level. - To open one: Google Earth on the web or a phone, Google My Maps, or QGIS. To see what is inside, rename it to
.zipand unzip it. - KMZ to KML: unzip it and keep
doc.kml. That file is the KML. - A DJI waypoint mission is also a KMZ, but in DJI's own WPML format: Google Earth shows little of it, and a Google Earth KMZ will not fly. See how to import a KMZ into DJI Fly.
What a KMZ file is
KML is an XML text format for showing geographic data in an Earth browser such as Google Earth. It describes placemarks, paths, polygons, image overlays and how they look. Google submitted KML to the Open Geospatial Consortium, which adopted KML 2.2 as a standard (OGC 07-147r2) and later KML 2.3 (OGC 12-007r2).
A KMZ is the zipped form. Google's KML documentation defines it as a main KML file and zero or more supporting files packaged with a Zip utility into one archive. The main file can have any name ending in .kml, doc.kml by default, as long as there is only one. Images, icons and 3D models sit in subfolders and are referenced with relative paths, so the whole map travels as one file.
Zipping text shrinks it a lot: Google gives a typical ratio of 10:1 and suggests a KMZ once the KML passes about 10 KB. The registered media type is application/vnd.google-earth.kmz, and a KMZ starts with the same bytes as any ZIP file.
KML vs KMZ
The map data is the same. Pick KML when you want to read or edit it as text; pick KMZ to send it, or when it carries pictures or models.
KML and KMZ hold the same map data. A KMZ is the KML file packed in a ZIP archive, often with images and models.
What it is
- KML
- Text (XML)
- KMZ
- ZIP archive with one KML
Images and 3D models
- KML
- Links only
- KMZ
- Can be inside
Size
- KML
- Full
- KMZ
- Often a tenth
Open in a text editor
- KML
- Yes
- KMZ
- No, unzip first
Media type
- KML
- application/vnd.google-earth.kml+xml
- KMZ
- application/vnd.google-earth.kmz
How to open a KMZ file
Free ways to open a KMZ on a computer or a phone, from quickest to most capable.
Google Earth on the web, no account
Open Google Earth in a browser, choose Open local KML editor, then Open KML from device and pick the file. No sign-in needed, and the file stays on your computer.
Google Earth on the web, in a project
Signed in, to keep it in a project: New, then Import file, Upload from device. Google Earth takes up to 10,000 features per import and opens bigger files as a read-only data layer.
On an iPhone or Android phone
In the Google Earth app, open a project and tap More, then Import file to project. Without a project: the Local tab, New, Local KML editor, Open KML/Z from device.
Google My Maps, to share a map
Add layer, then Import under the new layer. My Maps takes KML and KMZ up to 5 MB unzipped. Tours, 3D models, image overlays and folders may not come along.
QGIS, to measure or convert
Drag the KMZ into QGIS. QGIS reads KMZ when its GDAL includes the LIBKML driver (Settings > Options > GDAL lists the drivers); if yours does not, unzip the file and open
doc.kml, which GDAL's plain KML driver reads.
KMZ to KML, and what is inside
Rename it to .zip
Change
map.kmztomap.zip. The contents are unchanged: a KMZ is a ZIP file with another ending.Unzip it
Double-click on a Mac or choose Extract All on Windows. You get the main KML, usually
doc.kml, and any folders of images or models.Keep doc.kml as the KML
That file is the KML. If it points to images in the folders, keep them next to it, or the icons and overlays go missing.
Shapefile or GeoJSON
Open the KMZ or the KML in QGIS, right-click the layer and choose Export > Save Features As, then pick ESRI Shapefile or GeoJSON. KML coordinates are always WGS84 longitude and latitude (EPSG:4326); set a local CRS in the same dialog if you need survey coordinates.
The KMZ a DJI drone flies
DJI Fly and DJI Pilot 2 store waypoint missions as KMZ files too, but in DJI's WPML format: inside the ZIP sit wpmz/template.kml and wpmz/waylines.wpml, and the drone flies the waylines file, with heights, speeds, gimbal angles and photo actions in DJI's own tags. A KMZ made in Google Earth has none of that, so DJI Fly cannot fly it. The other way round, Google Earth reads only the .kml file in the archive, and in a DJI Fly mission that file holds no waypoints, so it shows little or nothing.
DJI Fly also has no import button: a mission goes in by replacing a placeholder mission's file under exactly the same name, at most 200 waypoints each. The DJI Fly KMZ import guide has the folders on an iPhone and on a DJI RC 2, and the DJI waypoints guide what a mission can do.
- Google Earth KMZ: a map to look at. Placemarks, paths, areas, overlays.
- DJI WPML KMZ: a mission to fly. Waypoints with height, speed, heading, gimbal and camera actions.
- Same .kmz ending, same ZIP container, different contents.
Where Skyplanr fits in
Skyplanr writes both files. Draw the area or pick the building, and it plans the flight, checks it with 106 rule-based checks and gives you the DJI Fly KMZ to fly. The same plan downloads as a KML for Google Earth, with the route at its planned heights, each waypoint and the takeoff spot, so you can look it over before you go.
See the technologyQuestions
What is a KMZ file?
A map file: a KML file, the XML format Google Earth uses, compressed in a ZIP archive together with any images or models it uses.
How do I open a KMZ file?
In Google Earth on the web (Open local KML editor, no account needed), in the Google Earth app on a phone, in Google My Maps, or in QGIS.
What is the difference between KML and KMZ?
The data is the same. KML is plain text; KMZ is that text zipped, often with images or 3D models, and often about a tenth of the size.
How do I convert a KMZ to KML?
Rename the file from .kmz to .zip, unzip it, and keep doc.kml. That file is the KML.
Can I fly a Google Earth KMZ in DJI Fly?
No. DJI Fly flies KMZ files in DJI's WPML format, with waypoints, heights and camera actions in DJI's own tags. A Google Earth KMZ has to be rebuilt as a DJI mission first.
Sources
Skyplanr is not affiliated with the third-party guides linked here.
- Google Developers: KMZ files (one main KML, doc.kml by default, relative paths, about 10:1 compression) (developers.google.com)
- Google Developers: KML tutorial (KML is XML; media types for KML and KMZ) (developers.google.com)
- OGC: KML standard (submitted by Google; KML 2.2 is OGC 07-147r2, KML 2.3 is OGC 12-007r2) (ogc.org)
- IANA: application/vnd.google-earth.kmz (a zip-compressed archive with at least one KML file) (iana.org)
- Google Earth: import KML and KMZ files (web, Android and iOS; 10,000 features per import) (developers.google.com)
- Google My Maps: import map features (KML and KMZ up to 5 MB unzipped) (support.google.com)
- GDAL: LIBKML driver (reads and writes .kml and .kmz) (gdal.org)
- GDAL: KML driver (plain KML, not KMZ-aware) (gdal.org)
- QGIS documentation: opening data (drag and drop, GDAL drivers under Settings > Options > GDAL) (docs.qgis.org)
- QGIS documentation: Save Features As (ESRI Shapefile, GeoJSON and other formats, change of CRS) (docs.qgis.org)
- DJI Developer: DJI WPML overview (the KMZ format DJI Fly reads) (developer.dji.com)
This guide describes how DJI Fly behaved when it was last checked; DJI can change the app at any time. It is advice, not a permission: you are the pilot in command, and the site, the geo-zones and the rules are yours to check before takeoff.
Let Skyplanr write the file.
Describe the job, and Skyplanr plans the waypoint mission, checks it and gives you the KMZ for DJI Fly.