SVG

From OpenStreetMap Wiki
Jump to: navigation, search
Screenshot of Adobe Illustrator showing a Maperitive-generated SVG map.

Scaleable Vector Grapics. XML format for representing vector graphics.

XML & XSLT pages contain closely related matters.

Ways to create an SVG map from OpenStreetMap

There are several ways to create an SVG map from OpenStreetMap

  • Easiest method is to use the Export tab on the frontpage. Use options Format to export=Mapnik Image and Format=SVG.
This is Mapnik rendering to a cairo surface (cairographics.org) The result is often rather bloated over-complicated SVG file. Maps are quite complicated, but Mapnik tends to create lots of little objects where one big object could have been used. This is particularly true of text on the roads, where each letter is a separate text element (twice)
  • With Osmarender. See Osmarender/SVG
  • Kartograph provides frameworks in phyton or JavaScript to produce vector based maps, and can display them in any browser.

Software for working with SVG files

Software for working with SVG files includes:

  • Inkscape is an open source vector graphics package which uses SVG as its native format. It seems to cope well with SVG from the export tab.
  • Adobe Illustrator ... see also Exporting to Adobe Illustrator
  • All modern Internet Browsers (Internet Explorer since Version 9) are also capable of viewing svg-files. Just open it to view, and rightclick to see the svg-source. You might want to try and edit the svg-file using your favourite text-editor.

Use in Wikipedia

Wikipedia allows direct upload of SVG files. This is the preferred approach on Wikipedia for images which are essentially vector based. It's also good to be able to perform vector based tidying up tweaks in inkscape prior to uploading. There are some small problems with Wikipedia's SVG renderer (one-way arrows) More information at wikipedia:Wikipedia:WikiProject OpenStreetMap#'Export' Tab. Example SVG image on Wikipedia: wikipedia:File:Holborn-viaduct-map.svg

See also