Shapefile to KMZ Converter: Send GIS Data to Anyone

All tools
Report

Heading to the field? Install this site from your browser menu and this tool works with no signal. See how

Converter

Nothing is uploaded. The file is converted on your own device, so it works with no signal.

Drop a file here or

Nothing leaves your device.

No file to hand?

Waiting for a file.

Features in this file

NameTypeFolderVerticesLengthArea

A three way size comparison for the same 2000 survey points. As a shapefile set the total is 116 kB across four files: 55 kB of .shp, 45 kB of .dbf, 16 kB of .shx and 145 bytes of .prj. As a plain KML it is 441 kB in one file, nearly four times larger. As a KMZ it is 17 kB in one file, 25 times smaller than the KML and 6.6 times smaller than the shapefile set. A note explains that every row of the .dbf becomes ExtendedData, which is what Google Earth shows in the balloon when a point is clicked.
The surprise is the middle column. Converting a shapefile to plain KML makes the file substantially bigger, and only zipping it turns that around.

How to use this tool

Zip the shapefile set together, .shp, .shx, .dbf and .prj, and drop the zip on the panel above. Check the coordinate system line and the map, then press Convert to KMZ and download. What comes back is a single file that opens on a phone, a laptop, or in Google Earth on the web, with no GIS software involved.

If you want the uncompressed form, because you intend to open the file in a text editor or feed it to something that cannot unzip, use the Shapefile to KML Converter instead. The geometry is identical. The only difference is the wrapper.

What a KMZ actually is

A KMZ is a zip archive with the extension changed. Inside it there is normally a single file called doc.kml, and alongside that there can be icon images, ground overlays and legend graphics. Rename a KMZ to .zip and any unzip tool will open it, which is a useful trick when you want to check what someone sent you.

That is the whole format. There is no separate KMZ specification, no different data model, and nothing you can store in a KMZ that you cannot store in a KML. The compression is the entire point.

A worked check you can repeat on paper

Take a real dataset: 2000 survey points, each with a name and two attribute columns. Here is what the same information weighs in each format, measured rather than estimated.

  • As a shapefile set: 55 kB of .shp, 45 kB of .dbf, 16 kB of .shx and 145 bytes of .prj. That is 116 kB spread across four files that must all travel together.
  • As a plain KML: 441 kB in one file. Nearly four times the shapefile set it replaced.
  • As a KMZ: 17 kB in one file.

The KML being four times larger than the shapefile surprises people, so it is worth understanding why. A shapefile stores a point as two 64 bit numbers, 16 bytes, with the field names written once in the .dbf header. KML writes the tag names again for every single feature. One placemark carries its opening and closing Placemark tags, a name element, a Point element, a coordinates element and an ExtendedData block with a Data element and a value element for each column. That is roughly 220 bytes of tag names and punctuation wrapped around about 25 bytes of actual coordinates.

Which is exactly why it compresses so well. Those tag names repeat identically 2000 times, and repetition is what a compressor eats. 441 kB becomes 17 kB, a ratio of about 25 to 1. Compare that with a JPEG photograph, which is already compressed and might shrink by a few percent at best.

The end result is a file 6.6 times smaller than the shapefile set it came from, in one attachment rather than four, holding exactly the same geometry and the same attributes. That is an unusual trade with no downside.

What happens to your attribute table

Every row of the .dbf becomes ExtendedData attached to a placemark. In Google Earth, that is what appears in the balloon when someone clicks a point. A shapefile that only a GIS analyst could query becomes a map that anyone in the business can interrogate by clicking on things.

This is the strongest practical argument for the format and the reason to convert rather than send the shapefile. The recipient does not need software, a licence, or any idea what a .dbf is. They need to double click an attachment.

Two limits worth knowing. Attribute names arriving from a .dbf are already capped at ten characters by that format, so a column reading measured_d in Google Earth was probably measured_depth_m before somebody converted it. And a shapefile holds one geometry type, so if you want boreholes, tracks and boundaries in one KMZ, convert each shapefile separately and merge the results in Google Earth.

How this was checked

The zip writing is not taken on trust. The CRC32 checksum implementation is verified against the published test vectors, including the standard check value of 0xCBF43926 for the string 123456789, and against 400 random binary buffers. Archives this tool writes are then opened by two independent zip libraries that share no code with it.

The full loop is tested end to end: a shapefile in UTM zone 12N goes in, comes out as a KMZ, is unzipped, the inner KML is parsed, and the coordinates are compared against where they started. The maximum drift is 2.3 nanodegrees, about a quarter of a millimetre, and the attribute values come back identical.

Mistakes that catch people out

Emailing a KMZ to someone whose mail system unzips attachments. Some corporate filters helpfully extract archives, which turns your KMZ into a loose doc.kml and breaks the link to any icons. If a recipient says the file will not open, ask what their mail system did to it.

Expecting the KMZ to carry your GIS styling. It does not. Colours, line weights and classification schemes live in your GIS project, not in the shapefile, so there is nothing for the converter to carry across. If the styling matters, set it in Google Earth after converting, or write the class into an attribute column first.

Assuming a smaller file means data was dropped. It does not. Compression is lossless. The 17 kB KMZ holds every coordinate and every attribute that the 441 kB KML held.

Sending a KMZ when the recipient wanted GIS data. If they are going to analyse rather than look, they want the shapefile. A KMZ is for people who want to see where things are.

Forgetting the ten character attribute names came from the shapefile, not from this tool. If the names matter, rename the columns in your GIS before exporting.

Related Calculators and Reference

Sending data out to non specialists is usually the last step, and the tools below cover what comes before and after it.