[OSM-talk] SVG from OpenStreetMap

Tom Carden tom at tom-carden.co.uk
Fri Mar 17 13:01:53 GMT 2006

For those who don't follow the OpenStreetMap wiki too closely, I just
wrote a post to the new OpenGeoData blog highlighting Etienne's
interesting experiments with XSL transforms for generating SVG from
the OSM API's XML. (Excuse my TLAs).


I think this is really interesting for a number of reasons:

* SVG is a well supported format in editors such as Illustrator and Inkscape
* SVG is built in to Firefox
* The XSL transform happens on the client side, so it doesn't take
extra server resources (above the extra call to the API)
* SVG has built in support for rendering text along paths, making
drawing road names etc that bit easier

There are obviously some optimisations to be made in the SVG (Etienne
is already working on that I think), and the projection needs to be
generalised for any given API output (maybe needs help from another
XSL head?), but I think it's an excellent start and want to encourage
people to keep looking at this kind of thing.

There's no reason I can think of not to put an XSL style sheet
directly into the OSM API output, and link to it from the map viewer
for the current bounding box.  The only thing I'm not sure about is
how easy it is to save the resulting SVG (I had to use the 'copy XML'
option from the DOM inspection tool) and if it's ever going to work in
other browsers.

To help with getting the projection right, I've suggested to Steve
that the osm element in the XML output should have the bounding box
details, to avoid clients having to calculate them first.

Any other suggestions? Technical answers on a postcard to
dev at openstreetmap.org please :)



More information about the talk mailing list