kml to odt conversion

Writing a book, Automating Document Production - Discuss your special needs here
Post Reply
Akram
Posts: 23
Joined: Sat May 10, 2014 10:43 am

kml to odt conversion

Post by Akram »

I wonder if anyone has developed a workflow for converting Google Earth kml files (or the kmz equivalents) to nicely formatted odt documents, and is willing to divulge the details.

There are a couple of conversion utilities that take kml as input and export csv, which is at least a start, but they overlook any attached description, which is important to my application. There is also an OpenOffice plugin for converting kml files, but it appears to import only polygons, so that is no help either.

If I cannot find any ready-made tools, I may have to wrestle with the Python, but so be it.
Last edited by Akram on Mon Sep 08, 2014 11:06 am, edited 1 time in total.
LibreOffice 7.1.5.2 64-bit on Windows 10
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: klm to odt conversion

Post by Villeroy »

According to https://developers.google.com/kml/docum ... lreference kml is XML, ODF is XML. XSLT transforms one XML schema into another.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: klm to odt conversion

Post by acknak »

Akram wrote:I wonder if anyone has developed a workflow for converting Google Earth klm files (or the klz equivalents) to nicely formatted odt documents, ...
I thought viewing it in Google Earth was the nicely formatted way to view the kml ;-)

Do you want to view the information in the kml file, or do you want to view the xml structure itself?

If you need the latter, I'm sure there are generic xml syntax highlighting sites/software that will do the job for you. There may even be something packaged for OO Writer--there are syntax highlighting packages for several programming languages; I wouldn't be surprised if there's one for xml as well.
AOO4/LO5 • Linux • Fedora 23
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: klm to odt conversion

Post by Villeroy »

Well, there's still Google docs for Google maps: https://groups.google.com/forum/#!topic ... i5NNqCzpoI
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Akram
Posts: 23
Joined: Sat May 10, 2014 10:43 am

Re: kml to odt conversion

Post by Akram »

Gentlemen,

Thanks for the responses. XSLT looks interesting as it appears to have the potential to do a single-pass conversion from kml to odt. I'll be looking into it. I am thinking of handcrafting a short odt document correctly formatted for print, using a sample of the data in the kml file, then examining its xml to see what I need to reverse-engineer using XSLT.

AckNak, by 'syntax-highlighting packages' I presume you mean editors like Notepad++? I have already been using this to look inside the kml file.

Incidentally, what I am contemplating is publishing a gazetteer of information about some geographical sites. While the data is currently stored in kml format, most of it is text which is not easily accessible.
Last edited by Akram on Mon Sep 08, 2014 11:08 am, edited 2 times in total.
LibreOffice 7.1.5.2 64-bit on Windows 10
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: klm to odt conversion

Post by acknak »

If you do not need to automate the conversion--that is, if you just need to extract the text content--it can be done with a trivial xslt. You can then import the text into a Writer document and format however you like. Or, if you have a lot of repetitive entries and the end product will be something like a catalog, move the text into a spreadsheet and use merge to get it into a Writer document.
AOO4/LO5 • Linux • Fedora 23
Akram
Posts: 23
Joined: Sat May 10, 2014 10:43 am

Re: kml to odt conversion

Post by Akram »

Yes, this does need automation; it's huge. Moreover, in preliminary work to strip out the unwanted style and viewpoint information I've found several errors in the html used to display the place descriptions within Google Earth. I am going to have to fix all this up first I think.

So, do we consider this a 'solved' issue? There was no simple utility to do what I wanted, as I'd originally hoped, but the task is not insuperable either, just time-consuming.
LibreOffice 7.1.5.2 64-bit on Windows 10
Post Reply