TrailCam

Guides

How to convert a GPX file to KMZ

KMZ turns up next to KML often enough that the two get treated as interchangeable, but a KMZ file is not its own format. It is a KML file zipped into an archive, with room inside that archive for the icons or images the KML might reference. Converting a GPX track to KMZ is really two small, separate steps, and knowing that changes what is worth checking afterward.

The short answer

The fastest route is the same one used for converting to plain KML: a free online converter such as GPS Visualizer or gpx2kml takes a GPX upload and hands back a KMZ — some ask which of KML or KMZ you want, in which case pick KMZ. GPSBabel does the same conversion locally if you would rather not upload a route to someone else's server. If a KML file already exists from an earlier conversion, any zip utility turns it into a KMZ by compressing it and renaming the result with a .kmz extension, which is genuinely all a KMZ file is.

What a KMZ file actually is

Unzip a .kmz file and what is inside is a small folder: one KML file, almost always named doc.kml, sitting next to whatever supporting files that KML references — most often small image files used as custom placemark icons, and occasionally a photo or an overlay image tied to a specific spot on the map. The .kmz extension just tells Google Earth and other tools to treat that zip archive as a single openable map file, instead of expecting you to unzip it yourself first and point the software at doc.kml directly.

Why a destination asks for KMZ instead of plain KML

A KML file with no image references behaves identically whether it travels as plain KML or gets zipped into a KMZ — the zipping buys little beyond a somewhat smaller download, since XML text already compresses well on its own. KMZ starts to earn its keep once a map references outside files: a custom icon, an embedded overlay image, a linked photo. Zipping keeps all of that bundled together with the KML that points to it, so the whole thing survives as one file instead of arriving as a KML with broken links to images that never came along for the ride. It is also simply what Google Earth saves by default when you export a place or a folder from My Places, which is a large part of why so much KML circulating online is actually KMZ.

What survives the trip from GPX

Everything true of a plain GPX-to-KML conversion is true here as well, since the KMZ step is just compression layered on top of that same conversion. Two things are worth checking once you have a result:

  • Per-point timestamps: a plain KML LineString has no field for the time at each individual point, so a straightforward conversion can flatten a timestamped GPX track into a line with no timing information left at all. Some converters write the richer gx:Track extension instead, which does keep per-point time — worth unzipping the KMZ and checking doc.kml for a gx:Track tag if replay speed matters to you.
  • Elevation: most converters carry it across, since both formats support a numeric altitude per point, but spot-checking a few points after conversion beats assuming it made the trip untouched.

The zip step itself changes none of this either way. Compressing a file and reading it back out is lossless, so the KMZ wrapper never drops anything the KML inside it had not already lost during the GPX-to-KML step.

When KMZ is worth choosing over plain KML

For a route with no custom styling attached — just the line that was walked — plain KML and KMZ carry exactly the same information, and KML is the simpler file to inspect or edit by hand, since it opens as readable text rather than a zip archive. KMZ starts to matter once something is being built with attached icons or images: a map of several trailheads with a distinct pin for each, say, or a route paired with a photo overlay. Bundling all of that into one KMZ means whoever opens it later does not need every referenced image sitting in the right relative folder just for the map to render the way it was meant to.

Where TrailCam fits in

TrailCam records a route with GPS and exports it as GPX 1.1 — a single route or the whole history at once — or as a CSV summary; KMZ is not one of the export formats. If a destination specifically wants KMZ, that GPX file is what would go through a converter, in the same two steps described above. The video clips, photos and voice notes pinned to a route along the way stay inside TrailCam itself, the same as with any GPX or CSV export, and replaying the route in the app is what brings them back together with the line on the map. Export is part of the optional TrailCam Pro upgrade; the app itself is free to download.

Questions

Is a KMZ file a different format from KML?
Not really — a KMZ file is a KML file zipped into an archive, with room inside for any icons or images the KML references. Unzip one and the file inside is ordinary KML, usually named doc.kml.
Does Google Earth need a KMZ file, or will it open a plain KML?
Google Earth opens either one directly. KMZ is simply what Google Earth saves by default when you export a place or folder from My Places, which is why it shows up so often even though it is not required.
Do GPS timestamps survive a GPX to KMZ conversion?
Sometimes, depending on the converter. A plain KML LineString has no field for per-point time, so a basic conversion tends to drop timestamps; a converter that writes the gx:Track extension keeps them instead. That caveat applies at the GPX-to-KML step — zipping the result into a KMZ afterward does not change what is inside it.

Recording your own routes

TrailCam is an iPhone app that records your route with GPS, keeps video clips, photos and voice notes pinned to the spot where you took them, and exports the result as GPX 1.1 or CSV. It is free to download.

Download on the App Store