Skip to main content

Convert engineering DWG drawings to auditable GeoJSON (pure-Rust, no CAD software needed)

Project description

dwg2geo (Python)

Convert engineering DWG drawings to GeoJSON from Python — the pure-Rust dwg2geo converter as a native extension. No AutoCAD, no LibreDWG, no GDAL needed.

pip install dwg2geo
import json
import dwg2geo

result = dwg2geo.convert_file("drawing.dwg")           # or dwg2geo.convert(raw_bytes)
fc = json.loads(result["geojson"])                     # GeoJSON FeatureCollection (local drawing coords)

print(result["feature_count"], "features")
print(result["converted"])                             # per-entity-type counts
print(result["skipped"], result["failed"])             # with reasons — auditable

Options: convert(data, polygonize_closed=False, curve_tolerance=None).

The result dict mirrors dwg2geo's EmbedResult:

key meaning
geojson FeatureCollection string in the drawing's local coordinates
feature_count, model_space_entities totals
converted / skipped / failed per-entity-type outcomes with reasons
warnings conversion warnings
bbox [minx, miny, maxx, maxy] or None
source_sha256 hash of the input bytes (audit trail)

Features carry resolved CAD style metadata (layer, color_rgb, color_index, linetype, lineweight_mm, text properties…). Coordinates are local — georeference with e.g. pyproj using the drawing's known CRS; dwg2geo never guesses one:

from pyproj import Transformer
transformer = Transformer.from_crs("EPSG:31983", "EPSG:4326", always_xy=True)
lon, lat = transformer.transform(x, y)

Deterministic: the same bytes always produce byte-identical GeoJSON on a given platform (across platforms — native vs WebAssembly — a few floating-point values may differ in the last digit).

License: MIT.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dwg2geo-0.2.1.tar.gz (155.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

dwg2geo-0.2.1-cp39-abi3-win_amd64.whl (869.9 kB view details)

Uploaded CPython 3.9+Windows x86-64

dwg2geo-0.2.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (934.2 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

dwg2geo-0.2.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (865.5 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

dwg2geo-0.2.1-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (1.7 MB view details)

Uploaded CPython 3.9+macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

File details

Details for the file dwg2geo-0.2.1.tar.gz.

File metadata

  • Download URL: dwg2geo-0.2.1.tar.gz
  • Upload date:
  • Size: 155.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for dwg2geo-0.2.1.tar.gz
Algorithm Hash digest
SHA256 7a90996621e873656828943f5c5e51b5f4770928b77a60bd78e0cb357e6d1001
MD5 94822f8a232af4682657aa640997b1d3
BLAKE2b-256 77a0eddfa42dc440dba3394967bfe7e04bb64fe71a923f96600564d0622ff4c7

See more details on using hashes here.

Provenance

The following attestation bundles were made for dwg2geo-0.2.1.tar.gz:

Publisher: release-packages.yml on milkway/dwg2geo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dwg2geo-0.2.1-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: dwg2geo-0.2.1-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 869.9 kB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for dwg2geo-0.2.1-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 020142eb336147805807af7f28ad5061e2fd1edb2ad13b6c3b5f656223a5d120
MD5 25c0e7feea6fcde635570c93e2d23910
BLAKE2b-256 b6b3949d6433ba582bd4647da5af129af5af689c760ffb9de9288d694f7d22c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for dwg2geo-0.2.1-cp39-abi3-win_amd64.whl:

Publisher: release-packages.yml on milkway/dwg2geo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dwg2geo-0.2.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dwg2geo-0.2.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5df08217d388a206d61b575b65729039332a2fa057c7371dd51756cc51cf240d
MD5 57aa268e93704dda98048743354793a4
BLAKE2b-256 b468777f47a546a1cd8e192afd12b4ba095b65b913ada9c87440520bb490bbcb

See more details on using hashes here.

Provenance

The following attestation bundles were made for dwg2geo-0.2.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release-packages.yml on milkway/dwg2geo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dwg2geo-0.2.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for dwg2geo-0.2.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e5b819e55f38e30667bad326f3972eaa3c007f9a07df3782864051eb9f774c7f
MD5 a363c73d045aaaf1334d3a789fc24cdc
BLAKE2b-256 ea48c0bb3d1bb6688ab9b116e6505a2c2fca6be390bea85af67bbad73d432a9d

See more details on using hashes here.

Provenance

The following attestation bundles were made for dwg2geo-0.2.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release-packages.yml on milkway/dwg2geo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dwg2geo-0.2.1-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for dwg2geo-0.2.1-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 1839ee442dcf412666c5da459a48094054501dbca2b8d67a743f59a6267e03bf
MD5 8f49753511520aae8837cca0d9ba1517
BLAKE2b-256 638f060745a8b2f215bc574be987664a298bb12e673472dced3dcc3227bb8981

See more details on using hashes here.

Provenance

The following attestation bundles were made for dwg2geo-0.2.1-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: release-packages.yml on milkway/dwg2geo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page