Import a Lanelet2 (.osm) file
drawtonomy can read Lanelet2 OSM-format maps. Sample maps are available from the Autoware documentation.
Import the whole file
Section titled “Import the whole file”Every .osm import goes through a selection preview — there is no
“import everything immediately” shortcut. To bring in the whole file you
select all of it in that preview:
- Open the menu (the hamburger at the top left) → Import….
- Pick the
.osmfile. - drawtonomy parses the file and shows a preview map of the lanelets.
- Select everything (drag a box around the whole map, or use the select-all control), then click Import (N).
- The canvas fills with Lane shapes plus their connections.
If you only need part of a large map, select just those lanes instead — see Import only specific lanes below.
A minimal Lanelet2 file
Section titled “A minimal Lanelet2 file”If you just want something to import, this is the smallest valid Lanelet2
.osm — one lanelet made of two boundary ways (a solid left edge and a
dashed right edge) over six nodes. Save it as sample.osm and import it
with the steps above; drawtonomy renders a single lane with the correct
solid / dashed boundary styles.
<?xml version="1.0" encoding="UTF-8"?><osm version="0.6" generator="hand-authored-lanelet2-sample"> <node id="1" lat="0.0000000" lon="0.0000000"> <tag k="local_x" v="0"/><tag k="local_y" v="0"/><tag k="ele" v="0"/> </node> <node id="2" lat="0.0000900" lon="0.0000000"> <tag k="local_x" v="0"/><tag k="local_y" v="10"/><tag k="ele" v="0"/> </node> <node id="3" lat="0.0001800" lon="0.0000180"> <tag k="local_x" v="2"/><tag k="local_y" v="20"/><tag k="ele" v="0"/> </node> <node id="4" lat="0.0000000" lon="0.0000320"> <tag k="local_x" v="3.5"/><tag k="local_y" v="0"/><tag k="ele" v="0"/> </node> <node id="5" lat="0.0000900" lon="0.0000320"> <tag k="local_x" v="3.5"/><tag k="local_y" v="10"/><tag k="ele" v="0"/> </node> <node id="6" lat="0.0001800" lon="0.0000500"> <tag k="local_x" v="5.5"/><tag k="local_y" v="20"/><tag k="ele" v="0"/> </node> <way id="10"> <nd ref="1"/><nd ref="2"/><nd ref="3"/> <tag k="type" v="line_thin"/> <tag k="subtype" v="solid"/> </way> <way id="11"> <nd ref="4"/><nd ref="5"/><nd ref="6"/> <tag k="type" v="line_thin"/> <tag k="subtype" v="dashed"/> </way> <relation id="100"> <member type="way" ref="10" role="left"/> <member type="way" ref="11" role="right"/> <tag k="type" v="lanelet"/> <tag k="subtype" v="road"/> <tag k="location" v="urban"/> <tag k="one_way" v="yes"/> </relation></osm>The pieces that matter:
- Nodes carry the geometry. Lanelet2 stores real-world
lat/lon, and Autoware-style files also carry projectedlocal_x/local_y. - Ways are the lane boundaries.
type=line_thinwithsubtype=solidorsubtype=dashedsets the road-mark style you see on import. - The
laneletrelation ties oneleftway and onerightway into a drivable lane. Add more lanelets (and share ways between neighbours) to build a network.
Import only specific lanes
Section titled “Import only specific lanes”For large maps, importing every lane will slow the editor down. Use the lane-selection dialog instead:
- Open the menu → Import… and pick the
.osmfile. - drawtonomy shows a preview map.
- Click or drag to select the lanes you want.
- Click Import (N), where N is the number of lanes you selected.
Performance tips
Section titled “Performance tips”drawtonomy handles large maps, so you can import a full Lanelet2 file when you need to. When you only care about a section, importing just the lanes you need keeps the editor snappiest and avoids loading geometry you won’t edit.
After import
Section titled “After import”Imported lanes are full-fidelity Lane shapes; the connections from the Lanelet2 file are preserved. Edit, smooth, or export back without losing topology.
Round-trip and regulatory elements
Section titled “Round-trip and regulatory elements”drawtonomy keeps the original .osm XML as a sidecar when you import.
On export back to .osm (Lanelet2), original IDs and tags are
preserved, and regulatory elements you didn’t touch — traffic lights,
right-of-way, speed limits, stop signs — are re-emitted from that
source verbatim.
Imported regulatory elements also become editable: traffic lights, traffic signs (including speed limits), stop lines, and right-of-way relations come in as drawtonomy shapes linked to the lanelets they govern, and you can place new ones from scratch with the same UI. For LiDAR-aligned or city-scale authoring, use Vector Map Builder or JOSM.
See also
Section titled “See also”- Convert between OpenDRIVE and Lanelet2 —
use drawtonomy as a bridge to
.xodr. - Import an OpenDRIVE (.xodr) file — the same selection workflow for OpenDRIVE maps.
- drawtonomy.svg format — the lossless format for re-editing within drawtonomy.
- Generate lanes from a map — when you don’t have a curated map file.