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.

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.0.tar.gz (155.2 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.0-cp39-abi3-win_amd64.whl (869.8 kB view details)

Uploaded CPython 3.9+Windows x86-64

dwg2geo-0.2.0-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.0-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.0-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.0.tar.gz.

File metadata

  • Download URL: dwg2geo-0.2.0.tar.gz
  • Upload date:
  • Size: 155.2 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.0.tar.gz
Algorithm Hash digest
SHA256 c972b26208c4fc9caddc0dac885e55eb51e37ebcb82caa6fc50de4a1439dbce6
MD5 c2e17a5c69e22a3936dec905edc1dab6
BLAKE2b-256 0573016aa225d248c4028fd925eff2bf78ec6be4dc7a2ec7d23063584063e33b

See more details on using hashes here.

Provenance

The following attestation bundles were made for dwg2geo-0.2.0.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.0-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: dwg2geo-0.2.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 869.8 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.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 3f99ad272c9ed9dd6f8d8781463498df5ba206dd0a19b53cfba9892e36cefede
MD5 5e00a618d6787d095d00033b68921dd2
BLAKE2b-256 5e0e7e2b0c30f84ef735b6e0dbb42d4d61fb098e7898946cfa9353c9499f86a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for dwg2geo-0.2.0-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.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dwg2geo-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 12e06d1b5841d55278ffd755b0db71bce722c38884261a9dfa4636294c41be31
MD5 5883e3437d25dd14b07146e6340bc93f
BLAKE2b-256 579447b262ef0e2b3c258ffe9d2c3de1af4b91f08a3ecd95a711a2f2d2314bd6

See more details on using hashes here.

Provenance

The following attestation bundles were made for dwg2geo-0.2.0-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.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for dwg2geo-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 cb93cd5d3658401718cf63da7e9a0f4a64c714cc89ae6a990f739e7110ab2d8a
MD5 907a421cfc2a221789e87f7ceb94c62a
BLAKE2b-256 393d4d838061bc5d149b90f398dcae6ff3f250c5fead05535fa4e7eb3aa771d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for dwg2geo-0.2.0-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.0-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.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 21c5236301c486fc80fdf6ca1e3d7aec31349d05b182bb02c448e48abc31d9ec
MD5 776a4d5176a1c37112e24af651e22170
BLAKE2b-256 a1687629db19c23e3870403987d1f6713849c1c3be261a93be3b70da5bf83417

See more details on using hashes here.

Provenance

The following attestation bundles were made for dwg2geo-0.2.0-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