Inkscape SVG — What's Inside: Layers, sodipodi:* namespace, and Why Illustrator Loses Your Layers

2026-06-109 min read
SVGInkscapenamespacesodipodilayersvector

Inkscape SVG is a dialect of the W3C SVG standard supplemented with its own attributes and namespaces. From a web browser's perspective such a file is regular SVG, read and rendered without problems. From Inkscape's perspective — inside live layer metadata, guides, units of measurement, color palettes, undo history, templates. The main "extenders" are the inkscape:* namespace and its historical predecessor sodipodi:*. They do not break compatibility with the web standard (W3C explicitly allows extensions via namespaces) but turn SVG from "just a picture" into a full project document. When such a file opens in Adobe Illustrator or CorelDRAW, some metadata is lost — layers become groups, guides disappear, color palettes turn into free swatches. This article explains what Inkscape adds, how to maintain compatibility with other editors, and how to properly export OpenStreetMap maps for different purposes.

Map generation of Saint Petersburg city center
Nevsky Avenue, St Petersburg, 200×200 m. Export to Inkscape SVG preserves 16 OSM layers as `` groups — convenient for editing.

Brief history: from Sodipodi to Inkscape

Sodipodi is a vector editor started by Lauris Kaplinski in 1999 as a fork of the Gill project. Sodipodi worked natively with SVG, but the 1999 standard had no concept of layers, guides, units of measurement as user-level entities. To save these metadata, developers introduced their own XML namespace http://sodipodi.sourceforge.net/DTD/sodipodi-0.0.dtd (short prefix sodipodi:). The file remained valid SVG for a browser, but Sodipodi could read additional attributes and restore the working context.

In 2003 a group of Sodipodi developers split off and created Inkscape — a more design-oriented fork. Inkscape supported the sodipodi-namespace for backward compatibility and added its own http://www.inkscape.org/namespaces/inkscape (short prefix inkscape:). Over twenty-plus years dozens of attributes have accumulated in these two namespaces: layer labels, visibility modes, opacity, lock flags, guide orientation, document units, Inkscape version, object type (star, spiral, rounded rectangle).

W3C SVG 2 (Candidate Recommendation 2018, still being updated) added the layer concept as part of the standard, but in the form <g class="layer">, not via a special namespace. Inkscape long preserved its attributes for backward compatibility with its own older files; export to "Plain SVG" removes inkscape: and sodipodi:, giving clean W3C SVG.

What Inkscape SVG adds

Open a regular SVG from osm2cdr.ru in Inkscape, save File → Save As → "Inkscape SVG (*.svg)". In the file appear:

<svg xmlns="http://www.w3.org/2000/svg"
     xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.0.dtd"
     xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
     viewBox="0 0 1000 800"
     inkscape:version="1.3.2"
     sodipodi:docname="map.svg">
  <sodipodi:namedview
       id="namedview1"
       pagecolor="#ffffff"
       inkscape:zoom="1.5"
       inkscape:cx="500" inkscape:cy="400"
       showgrid="false"
       inkscape:document-units="mm">
    <inkscape:grid type="xygrid" />
  </sodipodi:namedview>
  <g inkscape:label="Buildings"
     inkscape:groupmode="layer"
     id="layer-buildings">
    <path d="..." />
  </g>
</svg>

What matters here. sodipodi:namedview is "the document view in the editor": zoom, pan, active layer, units, grid snap, guides. This data is needed only by Inkscape, useless for the web. inkscape:groupmode="layer" turns a regular <g> into a layer — Inkscape displays it in the Layers panel, you can hide, lock, reorder. inkscape:label="Buildings" sets the human-readable layer name shown in the UI.

Additional frequently encountered attributes: inkscape:locked="true" (layer locked from editing), inkscape:tile-cx and inkscape:tile-cy (object center in Tile Clone), sodipodi:type="star" or sodipodi:type="arc" (special figure type — star, spiral, arc), inkscape:transform-center-x (object rotation point).

Inkscape SVG export options: Inkscape / Plain / Optimized

The roundtrip problem: Inkscape → Illustrator → web

Take a typical scenario. A designer opens a Moscow map in Inkscape, separates layers into "Roads", "Buildings", "Parks", "Labels". Saves as Inkscape SVG. Hands the file to a colleague who only has Adobe Illustrator.

Illustrator opens the SVG but doesn't understand inkscape:groupmode="layer". It sees regular <g> groups. The Illustrator Layers panel after import shows one "Layer 1" with nested groups "Buildings", "Roads", "Parks". It works, but is less convenient: the "Hide all but selected layer" command doesn't apply, the group is not treated as a separate layer entity.

Next Illustrator saves the file. If File → Save As → SVG, by default Illustrator writes its dialect with namespace xmlns:i="http://ns.adobe.com/AdobeIllustrator/10.0/". The same story as with Inkscape, but far broader — Adobe adds dozens of attributes about color swatches, color management, Illustrator version. The file becomes 2–3× larger than the original and loses inkscape:* attributes.

Now the file lands in the browser via <img src="...">. The browser ignores both namespace wrappers (Inkscape and Adobe) and renders a clean SVG picture. Visually all works, but if a web developer wants to attach an event listener to a single "Buildings layer" — that layer is no longer findable. Solution: before handing off to a colleague for web, resave from Inkscape as "Plain SVG", then there will be no extra attributes and layers remain as regular <g> with meaningful ids.

Five working scenarios with Inkscape SVG

Designer makes a print map. Opens the osm2cdr.ru export in Inkscape, splits layers ("Building", "Road", "Water", "Label"), assigns each a color via the Inkscape UI, adds text captions, guides for centering. Saves as Inkscape SVG — all layers and guides remain at next open. Final export to PDF via File → Save As → PDF, ready for the print shop.

Web developer prepares SVG for an interactive map. Opens SVG in Inkscape, organizes layers, removes unnecessary ones (e.g. keeps only Roads + POI), renames ids for CSS selector convenience. Saves as "Optimized SVG" — this is plain SVG passed through built-in SVGO. The file becomes 30–50% smaller and contains no inkscape:* metadata. Ready for use in <img> or inline.

Illustrator makes a decorative map. Opens in Inkscape, adds accents — flowing curves, vintage frames, textures. Uses sodipodi:type="star" for POI icons. Saves to Inkscape SVG. A year later returning to the project — all nuances remain: figure types, trigonometric parameters of stars, guide placement.

Architect transfers a map to AutoCAD. Opens in Inkscape, simplifies geometry, cleans fills. File → Save As → chooses "Desktop Cutting Plotter (.dxf)" — Inkscape converts SVG to DXF, which AutoCAD reads natively. inkscape:* attributes are automatically removed — DXF doesn't support them.

Teacher prepares didactic material. A district map in SVG with hand-drawn marks and arrows for the lecture. Saves as Inkscape SVG (for future edits), in parallel exports a PDF (to hand out to students). Layers in Inkscape SVG allow adding annotations for the next lecture without redoing all material.

Map generation of Krasnodar city center
Krasnodar center, 200×200 m. Each of the 16 OSM layers in Inkscape shows as a separate row in the Layers panel.

Inkscape SVG vs Plain SVG vs Optimized SVG

Inkscape offers three SVG export options (File → Save As):

Option Size for typical 500×500 m map When to choose
Inkscape SVG 2.2 MB For your own rework a week/year later
Plain SVG 1.9 MB For handing off to Illustrator/CDR or the browser
Optimized SVG 1.2 MB Final web publication, UI icons

Plain SVG removes inkscape: and sodipodi: namespaces but preserves geometry and base styles. Optimized SVG additionally runs the file through built-in SVGO: removes duplicate attributes, rounds coordinates to 2 decimals, deletes invisible objects, collapses groups with a single transform matrix. Optimized SVG is visually indistinguishable from Plain SVG but weighs 30–50% less.

The main rule: for working in Inkscape save as Inkscape SVG. For handing off or for the web — Plain SVG or Optimized SVG.

Pitfalls and tips

File size. Inkscape SVG can be 10–15% larger than Plain SVG because of inkscape: and sodipodi: attributes. For on-disk working files the difference is not critical. For web publication — switch to Plain or Optimized.

Sodipodi data in production files. sodipodi:namedview contains zoom, pan, active layer — data that should not end up in a public SVG. Technically harmless, but it is "development-context leakage" into a product artifact. Plain SVG eliminates it.

UI icons and optimization. If SVG is used as an icon with thousands of repetitions (e.g. POI markers on a map), even a few extra kilobytes in each of 1000 files become megabytes. Here Optimized SVG plus a manual final pass through SVGO with aggressive settings is critical.

Illustrator compatibility on editing. If a colleague will edit the file in Illustrator and save back — use Plain SVG. Otherwise after the first Illustrator save inkscape:* attributes are lost and Inkscape cannot restore layers on return.

Fonts in Inkscape SVG. Inkscape saves font names as font-family="Liberation Sans". If the file opens on a machine without that font, browser/Illustrator substitute a fallback. For guaranteed rendering convert text to paths: File → Object → Object to Path. Downside: text becomes uneditable.

XLink namespace. Inkscape 1.0+ gradually moves away from legacy xlink:href in favor of plain href. But older Inkscape (pre-1.0) writes xlink:href, and some legacy browsers understand only that variant. If the map must work in IE11 — convert via SVGO with the compatibility option enabled.

Z-order and layers. Inkscape layers stack in order: top in the Layers panel renders on top of bottom. Inside the file this is simply the order of <g> elements in the tree — higher indices render later. For maps this means: labels must come after buildings and roads, otherwise they'll be covered.

How to get Inkscape SVG from osm2cdr.ru

Direct "Inkscape SVG" export from osm2cdr is not needed: osm2cdr emits plain W3C SVG, and Inkscape automatically adds its attributes and layers on open. Workflow:

Step 1: on osm2cdr.ru draw the district. Step 2: choose SVG format. Step 3: run export, download the file. Step 4: open in Inkscape (File → Open). Inkscape converts <g id="buildings"> into <g inkscape:groupmode="layer" inkscape:label="Buildings"> — layers appear immediately in the Layers panel. Step 5: edit, add, recolor. Step 6: File → Save As → choose the needed format:

  • Inkscape SVG — for your own further editing days/weeks later.
  • Plain SVG — for handing off to Illustrator/CDR/AutoCAD or for the web.
  • Optimized SVG — for final web publication.

For users who don't open Inkscape and just want SVG from the browser — osm2cdr delivers Plain SVG. It works in any editor.

Sources

← All articles