Trying to do some research into drought patterns of the US using KMZ files from droughtmonitor.unl.edu.

My problem is that there are too many files to work with. 857 total. Records are every 7 days from 01/04/2000 - 03/22/16

I would like to merge each year into one KML. Doing this in Google Earth from importing all the separate files is very time consuming and causes GE to crash about halfway through. Also I would like to clean up some folder names. Each folder is 66 characters and is repeated in the subfolder.

How would I merge multiple KMZ/L files into a single KMZ/L file and clean up the folder names?



Top folder: U.S. Drought Monitor Released: 2000/01/06 Valid 7am EST 2000/01/04
  Subfolder: U.S. Drought Monitor Released: 2000/01/06 Valid 7am EST 2000/01/04
Top folder: U.S. Drought Monitor Released: 2000/01/06 Valid 7am EST 2000/01/11
  Subfolder: U.S. Drought Monitor Released: 2000/01/06 Valid 7am EST 2000/01/11


Top Folder: Merged 2000 Drought Maps
  Subfolder: 2000/01/04
  Subfolder: 2000/01/11

Here is a link to a drought map KMZ. http://droughtmonitor.unl.edu/data/kmz/usdm_20000104.kmz

  • You may want to look into network links as a way to handle multiple KMLs. See: google.com/earth/outreach/tutorials/network_link.html
    – MaryBeth
    Mar 27, 2016 at 2:10
  • Do you know python? Is that an option? I think this is actually two questions. 1. Automating renaming all the folders and files. 2. Merging all the files together. They are both pretty simple with python.
    – RHB
    Mar 27, 2016 at 12:28
  • In your case you aren't constrained to KMZ because doughtmonitor provides other formats for the data like shapefiles. If you run into trouble merging your data in KML format, consider merging the shapefiles.
    – krock
    Mar 27, 2016 at 21:00

1 Answer 1


This sounds like a job for some scripting!

KMZ files are zipped KML files (rename it to .zip, and extract, to find the KML.) KML files are essentially XML files, a type of markup language which is readable in programs like Notepad++.

If you open the KML file in a text editor, you get stuff like this:

<?xml version="1.0" encoding="utf-8" ?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document id="root_doc">
<Schema name="missoulaparcel_subset" id="missoulaparcel_subset">
    <SimpleField name="gid" type="int"></SimpleField>
    <SimpleField name="parcelid" type="string"></SimpleField>


What you can do is identify the parts of a KML file that refer to individual features, and stitch them together into one (much larger) file. It appears as though the Placemark tag starts a feature, and /Placemark ends it - so it should be possible to (relatively easily) write a script to extract all of these features, and append them into a single file.

Alternatively, it looks like there are libraries like pyKML which can operate on KML files. I would probably try to use that, if I didn't feel like writing a script to do it manually.

  • Looks like I am going to have to learn Python. Any recommendations as to where to begin? May 21, 2016 at 13:10
  • I was able to accomplish a similar goal using some NodeJS libraries provided by Mapbox (github.com/mapbox), specifically togeojson, geojson-merge, & tokml. After unzipping and getting the KML files, you could use those tools to convert them to geoJSON, merge them, and convert back to KML. I uploaded the script to a website to make the process easy: kmlmerger.com , but feel free to view the source and edit it to your needs. Jul 14, 2017 at 22:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.