Simple SVG Qgis Plugin
SimpleSvg is a plugin which tries to save current map as SVG. Other then the normal SaveAsSVG in the composer, this plugin tries to keep the GIS-grouping intact:
layers in Qgis will be layers in Inkscape, symbol classes will be groups. Objects will have ids with the layername in it, so the id's kan be used of a search in
the xml-view of Inkscape.
At the moment it can only work with 'Old Symbology' both vector- and raster layers. A raster layer will be saved as image and included as an image element
with an external (to the file next to the svg).
The plugin wil NOT work with layers which have 'on the fly' projection enabled.
For lines and polygons it tries to save both pen and symbol style, most classifications are working.
For Points it can only save a point as a small colored circle.
Please sent further ideas and requests to richard@duif.net
A view of the Netherlands in qgis with a point, polygon and line vector layer, and a raster on the bottom:
Download the svg generated with the plugin: svgtest.svg
This svg loaded in Inkscape:
The plugin is available via the official contributed qgis repositories (as experimental plugin!) or you can download latest plugin in zip here
TODO's and idea's
- better gui with more options
- use labels or names for features/objects
- add help button
- use of world coordinates and projection in svg (not yet used in Inkscape??)
- handle 'on the fly' projection
- handle polygon with holes
- handle new symbology (simple symbolisation)
- including advanced svg tags
- use svg symbols as points
- css styling?
- linking xref's for styles for symbols (css?)
Versions
- 0.5 (08-2011): fix for wrong path for raster layer, individual g-element grouped by symbol, first steps to making it possible to use New Symbology ("singleSymbol", "categorizedSymbol", "graduatedSymbol"), label-color used now
- 0.4 (06-2011): IF qgis has (had) a label, use that field as inkscape:label for easy find/recognition of element; fix for unicode/utf-8 errors (problems with labels and filename with non-ascii characters; fix for bug with non-visible layers; cleanup of code and svg; viewport is now mapcanvas size
- 0.3 (06-2011): fix for invalid svg for polygons with holes, implementation for multilines added, special qgisview rectangle to clip/crop the map, qgis notice in svg added
- 0.2 (06-2011): handles rasters, grouping per layer, inkscape specific attributes, all classification of old symbology working
- 0.1 (0?-20??): initial version, for internal use
Resources and inspiration
Cartoweb
Mappetizer
Tips, comments, questions: richard at-sign duif.net (Richard Duivenvoorde)