Exports the current map to a SVG file.
export-svg [file=<output file>] [zoom=<zoom>] [map-scale=<map scale>] [compatibility=<Inkscape/Illustrator>] [compressed=<true/false>] [copy-images=<true/false>] [scale=<scale>] [ai-autorescale=<true/false>] [precision-typo=<true/false>]
All parameters are optional:
The command records a list of generated files. This list can be automatically forwarded to subsequent file commands like ftp-upload Command and zip Command.
export-svg Command does not cut the data exactly along the export boundaries. So, for example, any OSM ways that extend outside the boundaries will not be cut. However, the exported SVG file specifies the clipping rectangle for the actual area specified by the user, so the data outside of the user-defined boundary will not be visible.
The exported map can contain bitmaps. export-svg Command treats bitmaps in two ways:
When copying images, the command makes sure the images do not overwrite each other if they have a same name (this is especially problematic for web tiles). The command adds suffixes like .1 or .2 to duplicate file names.
If you want to copy your SVG export to some other computer or send it via Internet, it is suggested that you:
Due to the pretty buggy support which Adobe Illustrator provides for loading SVG files, it is not possible to have the same SVG optimally shown in both Illustrator and Inkscape. In other words, if you plan to use the SVG file in Illustrator, you should specify compatibility=illustrator parameter. Maperitive will in this case do some tweaks to the SVG file which allow it to be shown without any problems in Illustrator (tested in CS5). But do not expect this file to be usable in other SVG viewers/editors.
On the other hand, if you need a SVG file which can be shown in various Web browsers and editable in Inkscape, you should specify compatibility=inkscape parameter. Again, do not expect this file to be usable in Illustrator.
When rendering text on paths, Maperitive positions and renders each character separately to achieve the best effect. This is called precision typography.
The problem with precision typography in the context of SVG is that other software usually treats such text labels as a series of separate text elements (one element for each character). This can be a problem for big maps - see the Troubleshooting section below.
Precision typography is turned off by default, in which case SVG text elements will not be broken into individual characters. Instead, a text label will be broken into one or more parts based on the rotation angle of each part.
Not using precision typography can produce some irregularities in how the text is rendered, usually in form of poorly spaced characters. This can be corrected manually in the SVG editor, but if you want to avoid this, try turning on the precision-typo parameter and pray that your map can be loaded in the SVG editor.
Some SVG renderers (like Inkscape and Illustrator) do not have a good image scaling algorithm, so certain bitmaps can appear rather grainy (see the example of hillshading below) compared to how they look in Maperitive. I will try to implement an automatic rescaling for SVG exports in the future.
There is a limit of what both Inkscape and Adobe Illustrator can import. Although SVGs generated by Maperitive are usually not very large (up to 10 MB of file size), the file size is not the real indicator of whether these programs can "swallow" your map or not. The principal guideline is the complexity of the map: how many graphical elements it contains.
From my experience the biggest bottleneck is the number of text elements on your map. As an example I worked on a city map for Dublin, Ireland which contained around 25,000 individual text elements. This number can become large because street labels tend to be broken into several separate text elements due to the fact that Maperitive has to render each letter separately for very winding roads.
The sheer number of text elements proved to be a problem for me - my map would not load either in Inkscape or in Illustrator. There are several solutions for this problem, but none of them is an ideal one:
Adobe Illustrator has a limit of 16345 pixels for the width and height of its canvas (a.k.a. artboard). Maperitive by default uses 1:1 scaling when rendering SVG elements, so the actual coordinates of elements correspond to those on the screen. If your map is very large, it could exceed this limit. There are two ways to solve this: