β—† Rust Β· CAD β†’ GIS

Turn DWG drawings into auditable GeoJSON.

A command-line converter that never presents unreferenced CAD coordinates as geographically correct β€” with per-entity diagnostics and deterministic, traceable reports.

CI Release License MIT Rust 1.85+ Platforms crates.io npm PyPI

Built for engineering data, not screenshots

Every design choice serves one goal: output you can trust and verify β€” no silent loss, no fake georeferencing.

🧭

Fails closed on CRS

Requires a source CRS or an explicit local-coordinate override. Drawing units are trusted only when the header is unambiguous; otherwise you state them.

πŸ”Ž

No silent loss

Every unsupported, skipped, failed, or approximated entity is counted with a reason and sample handles. The accounting must balance β€” or it warns.

πŸ¦€

Pure-Rust native backend

Reads DWG in-process via acadrust β€” no LibreDWG or GDAL needed. A self-contained binary that runs anywhere.

πŸ“

Real engineering geometry

OCS→WCS arbitrary-axis transforms, bulge arcs, deterministic curve tessellation, nested INSERT/MINSERT expansion, and hatch loops with holes.

🌍

PROJ reprojection & calibration

In-process PROJ reprojection with resolved units and axis order, plus local control-point calibration for drawings without a CRS.

🧾

Deterministic output

Same input, same GeoJSON bytes. A sidecar report records options, tool versions, source hash, bounding boxes, geometry checks, and outlier scans (its timing fields are the only run-to-run variation).

Entity coverage

The native backend converts the common civil/utility drawing set β€” and every one of the 44 acadrust entity types has a documented policy, checked by a test.

POINTLINELWPOLYLINEPOLYLINE 2D/3DARCCIRCLEELLIPSESPLINE3DFACESOLIDHATCHTEXTMTEXTINSERT / blocks

Bulge arcs and splines tessellate under an explicit chord tolerance; hatches nest into Polygons/MultiPolygons with holes; blocks expand with full transform composition and provenance. Deliberately unsupported types (rays, ACIS solids) and not-yet-converted types (dimensions, leaders, meshes) are reported, never guessed.

How it works

One header inspector, two backends, and a single writer β€” the pure-Rust path builds a CAD-neutral model that every transform and check operates on.

dwg2geo architecture: DWG input flows to the header inspector, the external LibreDWG/GDAL backend, or the native backend that builds a CAD-neutral model and writes GeoJSON with a report.

Conversion pipeline & key parameters

Fail closed on coordinates, resolve units, transform, validate, then write deterministically.

Conversion pipeline: coordinate policy, units, geometry, validation, and deterministic output, with the CLI flags at each stage.

Install & run

Grab a self-contained binary, install from your ecosystem's registry, pull the container, or build from source.

# Rust β€” crates.io (CLI or library)
$ cargo install dwg2geo

# JavaScript / WebAssembly β€” npm (runs in the browser, no native deps)
$ npm install dwg2geo

# Python β€” PyPI (wheels for Linux x86_64/aarch64, macOS, Windows)
$ pip install dwg2geo
# Prebuilt release binary (Linux/macOS/Windows)
# from github.com/milkway/dwg2geo/releases

# or build from source (Rust 1.85+)
$ cargo build --release --features native-backend

# add PROJ reprojection (needs system PROJ β‰₯ 9.6)
$ cargo build --release --features native-reproject
# Slim container β€” native binary only, 28 MB, MIT-clean
$ docker build -t dwg2geo .
$ docker run --rm -v "$PWD:/w" dwg2geo \
    inspect /w/drawing.dwg --json

# check optional external tools
$ dwg2geo doctor
01

Inspect

Signature, version, units, extents, layer & entity histogram.

02

Choose CRS

Source CRS + units, or explicit local coordinates.

03

Convert

Native or external backend to deterministic GeoJSON.

04

Verify

Read the sidecar report β€” accounting, checks, bounds.

Transparent by construction

Multi-platform CI, a three-way independent audit, a verified architecture refactor, and a clean license posture.

βœ…

CI on every platform

fmt Β· clippy -D warnings Β· full test suite on Linux, macOS, and Windows, plus a PROJ-enabled reprojection job.

πŸ›‘οΈ

Audited & verified

Independent correctness, completeness, and robustness passes; findings fixed and re-verified against a baseline build.

πŸ“¦

SBOM & licenses

A CycloneDX SBOM and a full third-party license report ship with the repo; a CI gate blocks any new copyleft dependency.

ComponentLicenseDistribution
dwg2geo + native depsMIT / permissiveRedistribute freely β€” release binaries & slim container are MIT-clean.
acadrust (DWG reader)MPL-2.0File-level copyleft; binary distribution is unrestricted, no effect on dwg2geo's source.
LibreDWG (external backend)GPL-3.0Invoked as a separate process, never bundled β€” installed by the user, so no GPL propagation.