OpenStreetMap to DXF in the Slovenian grid D96/TM: worked example

Central Ljubljana from OpenStreetMap to a DXF in EPSG:3794, step by step with screenshots, and a hand check of a projected coordinate and of a bridge length.

 Open this example in the tool Download the sample file below and choose it in the tool.

Problem

You need a base map of the old town of Ljubljana for a site plan, in the Slovenian national grid D96/TM, before any survey is available. OpenStreetMap has the streets, the buildings and the river. How do you get them into CAD on the right coordinates, and how do you know the coordinates are right?

Area14.5045 – 14.5085° E, 46.0498 – 46.0522° N, about 310 × 270 m around the Triple Bridge (Tromostovje)
DataOpenStreetMap, downloaded on 21 November 2026, © OpenStreetMap contributors, ODbL
Sample fileljubljana_centre.osm (272 kB, 2134 nodes, 390 ways, 39 relations)
Target CRSEPSG:3794, Slovenia 1996 / Slovene National Grid (D96/TM)

The sample is a trimmed copy of the OpenStreetMap download: we kept the map features and their names and dropped the edit history (user, version, timestamp), which the tool does not read. It is shared under the same licence, the Open Database License.

1. Download the OpenStreetMap data

On openstreetmap.org, zoom to the site and click Export. Manually select a different area lets you draw the box, and Export downloads a file called map.osm. The website export stops at 50 000 nodes, a few square kilometres of town. For a larger area use an Overpass query or a regional extract.

The download contains every way that touches the box, in full. That is why the Ljubljanica river in the sample runs well outside the area: the river is one long way in OpenStreetMap.

2. Convert it in the tool

Choose the file, keep the target CRS EPSG:3794 and set Road detail to All roads + footpaths/cycleways. The old town is pedestrian, and with All roads only 6 of its 126 streets and paths come through, because pedestrian streets and footways count as paths.

OSM to DXF tool with ljubljana_centre.osm chosen, target CRS EPSG:3794 and road detail set to all roads plus footpaths
The tool with the sample file, EPSG:3794 and all roads + footpaths.

Click Convert. The conversion takes a second, and Download DXF gives the drawing.

Result panel of the OSM to DXF tool with the Download DXF button
The result panel. The uploaded file is not kept on the server.

3. The drawing

The DXF opens in AutoCAD, BricsCAD, QCAD or any other CAD program. With simple layers the sample gives 137 building outlines on OSM_BUILDING, 126 streets and paths on OSM_HIGHWAY, the river on OSM_WATER, and the shops, cafés and sights as points with labels. Each polyline carries its OpenStreetMap tags as XDATA (application OSM_ATTRIBUTES), for example osm_id=453076140, bridge=yes, name=Tromostovje.

The converted DXF of central Ljubljana: streets in green, buildings in magenta, labels in yellow and red
The converted DXF, cropped to the download box. Data © OpenStreetMap contributors.

Streets are polylines with a width by street type (1.5 m for a pedestrian street), so they read as streets on a plot. The drawing does not sit at the national grid coordinates but near the origin: the tool subtracts a local origin rounded to 1 km, X0 = 461 000 m, Y0 = 100 000 m, and writes it in a note on layer OSM_ORIGIN_NOTE. Large coordinates lose precision in some CAD programs, and this avoids it. To place the drawing in the national grid, move it by (461 000, 100 000) or insert it with that base point.

4. Check of a coordinate

The middle span of the Triple Bridge is way 453076140, two nodes. Its south end is at φ = 46.050994° N, λ = 14.5063005° E. D96/TM is a transverse Mercator projection on the GRS80 ellipsoid with central meridian λ0 = 15° E, scale factor k0 = 0.9999 and false easting 500 000 m. To first order the easting is:

N = a / √(1 − e² sin²φ) = 6 378 137 / √(1 − 0.00669438 · 0.5183) = 6 389 231.8 m
Δλ = (14.5063005 − 15) · π / 180 = −0.00861668 rad,   cos φ = 0.694018
E ≈ 500 000 + k0 N cos φ Δλ = 500 000 + 0.9999 · 6 389 231.8 · 0.694018 · (−0.00861668) = 500 000 − 38 204.6 = 461 795.38 m

The full series adds 0.02 m. In the DXF the vertex is at x = 795.393, i.e. E = 461 000 + 795.393 = 461 795.39 m. The northing needs the meridian arc, a longer series; the length check below tests the north–south direction instead.

5. Check of a length

The north end of the span is at φ = 46.051256°, λ = 14.5061304°. On the ellipsoid, at the mean latitude:

meridian radius M = a (1 − e²) / (1 − e² sin²φ)3/2 = 6 368 558.7 m,   N = 6 389 231.9 m
Δy = M Δφ = 6 368 558.7 · (0.000262 · π / 180) = 29.122 m
Δx = N cos φ Δλ = 6 389 231.9 · 0.694016 · (−0.0001701 · π / 180) = −13.164 m
Lground = √(29.122² + 13.164²) = 31.959 m on the ellipsoid

A map projection changes lengths by its scale factor. In transverse Mercator it grows with the distance from the central meridian, here x = −38 211 m:

k = k0 (1 + x² / (2 R²)) = 0.9999 · (1 + 38 211² / (2 · 6 378 887²)) = 0.9999 · 1.0000179 = 0.999918
Lgrid = k · Lground = 0.999918 · 31.959 = 31.957 m

The DXF polyline runs from (795.393, 1362.332) to (782.411, 1391.533): √(12.982² + 29.201²) = 31.957 m. A grid length in central Slovenia is 0.008 % shorter than on the ground, 8 mm per 100 m. That is far below what OpenStreetMap is accurate to, but it matters if you set out from the drawing.

Zoom on the Triple Bridge in the converted DXF
The Triple Bridge in the DXF. The checked span is the middle one, labelled Tromostovje along the street axis. Data © OpenStreetMap contributors.

Result in the tool

Hand calculationToolDifference
Easting of the bridge end461 795.38 m (first order)461 795.39 m0.02 m
Local origin(461 000, 100 000) m(461 000, 100 000) m0
Length of the middle span, grid31.957 m31.957 m0
Length on the ellipsoid31.959 m–

Your own case

  • OpenStreetMap is a volunteer map. Building outlines are usually traced from aerial images and can be a metre or more off. Use the drawing for planning and orientation, and a survey or the cadastre for design.
  • Credit the data on any drawing you share or publish: "© OpenStreetMap contributors", with the ODbL.
  • For other countries enter their EPSG code, for example EPSG:3912 for the old Slovenian D48/GK grid, EPSG:31256 for Austria (MGI / Austria GK East) or EPSG:3763 for Portugal (ETRS89 / PT-TM06). Leave the CRS blank to keep longitude and latitude in degrees.
  • Detailed layers splits the layers by type (OSM_HIGHWAY_PEDESTRIAN, OSM_BUILDING_CHURCH and so on), so you can freeze or recolour them in CAD.
  • To go the other way, the DXF to KMZ tool puts a drawing on Google Earth.

References

  • OpenStreetMap contributors. Copyright and licence, openstreetmap.org/copyright. Data under the Open Data Commons Open Database License (ODbL) 1.0.
  • EPSG Geodetic Parameter Dataset, EPSG:3794 Slovenia 1996 / Slovene National Grid.
  • Snyder, J.P. (1987). Map Projections: A Working Manual. U.S. Geological Survey Professional Paper 1395, chapter 8 (transverse Mercator).

Worked example by Martin Hostnik, updated 2026-11-21. Results are for checking and preliminary design; verify them for your project. Questions or a correction: [email protected].