View Full Version : KML / XML editors
Munden
07-05-2008, 06:31 PM
I'm seriously considering writing my own placemark editor using Java. It would be a KML editor allowing a user to keep templates and edit KML files to match these templates.
On the other hand if someone else knows of a tool out there for doing things like this, I'd certainly like to know. :) The idea is to open up a KML file and see the list of placemarks and folders and be able to apply KML updates to any (or all) that I choose. I sometimes wonder if XML tools like XML Spy might do what I want, but it'd take work to figure out how to get the editor to do what I want I think.
Having to hand-edit some of these files is already a real pain. I'm working on updating the look of my reserve fleet placemarks and it's tiring. Even using VIM or some other text editor is slow. I can go faster just copying placemarks in Google Earth itself. The US silo placemark set involves more than 1,000 placemarks as I recall. I don't fancy the idea of having to dig through all of those one at a time.
Forkboy2
07-05-2008, 10:30 PM
Not sure exactly what you're trying to do, but you might be better off keeping your data in some kind of native format (spreadsheet, etc) that is easy to update and manipulate. Then figure out a way to export your data automatically to KML. Then you just make changes to your original data, and export an updated KML file when you need to.
For example, I do a lot of things with maps. I can take a folder with 500 JPG maps in it, and create a single KML file with network links to all those maps with about 10 clicks of the mouse.
There are also ways of creating KML directly from a Google Docs Spreadsheet. See here for some examples. http://gisplanet.blogspot.com/search/label/spreadsheets
I also use UltraEdit a lot. It's a powerful text editor with batch scripting language. You can do things like taking a list of X,Y,Z and insert that list of X,Y,Z anywhere you want into KML code. So if you had a simple list of Lan/Long/Description in a spreadsheet, you would just export that list to a TXT file, and then you can use UltraEdit to insert the KML code.
Munden
07-05-2008, 11:56 PM
Most of the placemarks I need to edit are packed with text, and trying to edit those in a spreadsheet later would be a problem. Plus, given that none of them are in a spreadsheet right now, it would take a lot of work to get them into one I fear.
To be more specific than my first post, I am trying to update placemarks with a template KML setup to eliminate the 'Directions' text on the bottom and to have various background colors for some of them as well. I'd be doing more if it were easier to just make a template set of KML code and then apply it.
I think one other bit of functionality I'd like is to allow it to compress styles. The files get massive mostly from clutter of two different icon styles that are exactly alike, but GE makes the duplicate when you copy and paste. Thankfully, Java should make all of that easy to handle. I'd just have to figure out how open I want the design to be, but this could be fun to put together.
Mickey
07-06-2008, 01:54 AM
I would think PHP/MySQL would be the way to go. Look at our StreetView database (http://www.gearthhacks.com/streetview/) as an example, but forgot that it's StreetView.
Every single one of those 1000+ locations has a dynamically generated KML for it (view the file on it's own page and notice the "View in Google Earth" link). If I wanted to change the format of that KML (eliminate directions, clean styles, etc), I could change it in ONE place and they'd all be updated.
Is that kind of what you're wanting to do?
Munden
07-06-2008, 02:18 AM
In part, yes. However, the issue isn't trying to create KML. I could just as easily do that with any number of products, even other scripting languages like Perl. That's the easy part, and I've done things like that in the past. :) I've had scripts edit XML and even PostScript documents.
My biggest issue is the method to edit placemarks. The disconnect between Google Earth and some external storage would probably end up annoying me too much. If I wanted to move a placemark I'd either have to work out a way to edit the storage or edit the placemark in Google Earth and then re-export .. or something. I prefer to do most of my work in Google Earth and just keep the single storage.
The problem with text editors is that each placemark has its own unique icon style name even though all of the styles are actually the same. (thanks to Google Earth's copy-paste rules)
The problem with generators is ripping out the relevant KML bits into a form which could then be reprocessed into a new set of placemarks.
I think I could deal with the disconnect if I could quickly save my placemark folder KML and then quickly just run a tool to strip out the important bits. (lat/lon, description, title, etc) Then I'd just run another tool on that file and load it back into Google Earth. As long as the placemarks all had the same 'template' I could probably find a way to do that without too much of a problem. PHP or something like that might work.
Mostly I was wondering if there were tools ready 'out of the box' that I could just grab and start running with. :) It sounds like no matter what type of solution I use, it'll require at least some scripting on my part.
Forkboy2
07-06-2008, 08:09 AM
Sounds like you'd probably need to create something from scratch to do exactly what you're trying to do. You might try NorthGates KML Editor....not sure if it does what you're trying to do though (http://www.northgates.ca/KMLEditor/)
Getting back to UltraEdit.....if you're kml file is a simple collection of placemarks, would not be difficult to convert it into a CSV text file.
You would simply extract all lines with <name>, <description>, and <coordinates> in them from your KML code. Then delete all instances of "<name>", "<description>" and "<coordinates>". Then replace "</name>^p", "</description>^p", and "</coordinates>" with commas. This should give you a comma separated list of your relevant data without any KML code. Once you have data in this format, you can do anything you want to it and process it back into KML with a macro.
For example, you could add a column to each row that would be a style code. Style1, Style2, Style3, etc. Depending on the style code you entered, UltraEdit would insert different code for that placemark when it creates the KML. Stuff like that...
Anyway.....good luck. Sounds like you got your work cut out for you either way.
Matt
Forkboy2
07-06-2008, 08:33 AM
Almost forgot....I haven't tried it, but KML Manager may do what you want.
http://www.mchme.com/
Matt
Munden
07-06-2008, 06:12 PM
It's all good advice, thanks. :) I took a look at the KML Manager, but the trial download link is broken. :( I think it's not quite what I want as I would bet it updates the description as well as any KML information, which I wouldn't want. I still wanted to check it out and make sure though.
bobbyp
08-31-2008, 04:23 PM
Does anyone out there know of a way to have a two-way link between MS Access and Google Earth? I have the same link using ODBC between MapInfo GIS and Access, but haven't been able to find anything that would do the same thing for GE.
The idea would be to have live access to the point file in Access, make any additions/deletions or move the points to the right locations and update the point database.
I am sure if I was a programmer this would be no big deal, but I'm not.
Any help is much appreciated.
BP
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.