Google Earth KMZ File Merging?
July 15, 2008 11:19 AM   Subscribe

GoogleEarthFilter: How can I merge the contents of multiple point-data KMZ/KML files? Long-winded explanation inside.

The engineering company for which I work is shifting from paper-based maps to Google Earth for site location records. There are a lot of old records to enter. I've been tasked with creating the procedure for multiple persons, during their non-project-scheduled time, to enter site locations and job names. These will all be point data, with a name and no description. The problem: 90% of my office is functionally computer illiterate.

If Joe Employee is tasked to enter data directly into the kmz file which contains all previously entered points, and then save it again, he will manage to save one single point over the entire file. This happened during our first trial run. The solution I've come up with is to have each person save their edits to a seperate kmz file, which I or the other computer-savvy individual can later merge into the main database.

I know you can drag and drop kmz files to create multiple nested sub-folders of points within Google Earth, but I don't -want- multiple nested sub-folders. I want all the points in one file. Google Earth will let you drag points from one folder to another, but only one at a time. How do I just rip all the points out of one file and stuff them into another?
posted by Phineas Rhyne to Computers & Internet (6 answers total) 1 user marked this as a favorite
The API that describes the KML format suggests that Google Earth files are XML.

This means you can parse the DOM, or structure, of a KML/KMZ file and manipulate it with any XML parser — you would pull out the nodes of interest from each KMZ file and pipe them into another file, for example.

There are XML parsers for many scripting languages, such as python or perl.
posted by Blazecock Pileon at 12:26 PM on July 15, 2008

It looks like you first need to unzip KMZ — KMZ looks like a zip-compressed version of KML. Just run unzip -p filename.kmz > filename.kml to get to the XML data.
posted by Blazecock Pileon at 12:37 PM on July 15, 2008

GPSBabel can merge many types of geodata, and even filter out duplicate (or near duplicate) points.
posted by scruss at 3:30 PM on July 15, 2008

what you need to do is open the kmz in google earth, save it as a kml. then you can open the kml to read the XML style of recording data with notepad or whatever. Reading then combining files to create one is a pretty simple process using python.
posted by figTree at 4:50 PM on July 15, 2008

Response by poster: GPSBabel appears not to function properly with Google Earth data. At least, I keep losing points when I merge files, and they aren't near-duplicates. That said, I will be keeping a copy for myself and my geocaching, so thanks much scruss.

Ugh. It appears I'm going to have to learn python. This will be a dubious process at best, but at least I know that's the right answer. If I manage to write something that doesn't make me cringe in pain, I'll post a link here, unless someone else wants the honor, in which case feel free!
posted by Phineas Rhyne at 11:28 AM on July 17, 2008

Merging KML files is as simple as creating NetworkLink tags

NetworkLink --> name --> link --> /
posted by mastermindg at 9:55 AM on January 9, 2009

« Older display/resolution problem with monitor/macbook   |   Hiking in upstate New York Newer »
This thread is closed to new comments.