
Hi everyone,
I'm interested in applying to create an KML - SVG converter. KML and SVG are similar enough that it makes sense for there to be a way to convert from one to the other. My plan would be:
From now until the end of week 1 or 2: Study both formats and work-out the
equivalents between KML and SVG. I know there are features of KML - namely, placemark descriptions, which will not convert directly to SVG. There are probably other features too. I'll try to deal with these in any time I have remaining at the end. I'll also need to work out a way to convert the coordinates systems, and deal with sizing the image - using the KML coordinates, the image would be very small, in a very large document. Then, develop a command-line app that will actually do the conversion. I'll be using C++. I haven't decided on an XML library yet - any suggestions? * Plan the structure of the program. * Focussing first on KML -> SVG, gradually add tags to convert, and check they work correctly. * Once KML -> SVG works, add SVG -> KML. Should be a case of reversing the existing conversion functions. * Write some usage documentation. Once the command-line program is working, I'll start on giving it a GUI. I can't seem to find anything about what UI library Inkscape itself uses - can anybody tell me? It would be better to use the same one, to make maintenance easier. The GUI will send commands to the command-line program, to keep the two separate, and so that Inkscape itself can use the command-line one at some point if needed. * Design the UI. * Implement it. * Write some user documentation. Deliverables: * A command line program that can convert SVG to KML, and back, successfully. * (Probably) A GUI to go with the command-line program. If I get time: * Allow importing/exporting as KML from within Inkscape. * Find ways of handling 'placemark' KML elements, and any others that do not convert easily to SVG, so that a user can convert to SVG, edit, and convert back, without losing anything. Possibly by including hidden elements in the SVG, or using comments. ----------------------- Is this a decent plan? Is there anything I've missed? ~Samuel Atkins

There have been some pretty good explorations using xslt to be the converter of xml. http://www.latenightpc.com/blog/archives/2004/12/16/xml-to-svg-with-xslt-par... http://vitali.web.cs.unibo.it/Progetti/VectorConverter Many more via googling. The creation of the xslt is not great fun. I'd actually like to meet an xslt-devotee.
MarkT

2010/4/5 sjatkins@...2336... <sjatkins@...2336...>:
Then, develop a command-line app that will actually do the conversion. I'll be using C++. I haven't decided on an XML library yet - any suggestions?
You should use libxml2 and libxslt - that's what Inkscape uses. However, it might be better to write an internal extension rather than a separate command line application. Look at src/extension/internal/. You can also consider using XSLT.
Once the command-line program is working, I'll start on giving it a GUI. I can't seem to find anything about what UI library Inkscape itself uses - can anybody tell me?
It uses GTK+ and gtkmm. Again, look at existing input extensions - the extension system should satisfy your GUI needs. You just put the parameters you need in an .inx file and the GUI is created automatically.
Regards, Krzysztof
participants (3)
-
Krzysztof Kosiński
-
Mark T
-
sjatkins@...2336...