AutoCAD drawings → Google Earth, in one step.
DWG / DXF in, a clean, georeferenced KMZ out.
Convert AutoCAD DWG / DXF drawings into a KMZ that opens correctly in Google Earth. It uses free, open-source tools and runs as a Claude Code skill or as standalone scripts.
Estate plans, field boundaries, irrigation layouts and survey drawings usually live in AutoCAD, in a projected coordinate system (UTM, Arc 1960…). Google Earth wants lon/lat KML. This tool:
- finds the drawing's coordinate system;
- reprojects the drawing;
- turns closed outlines into real polygons named from their labels;
- keeps each CAD layer as a folder;
- styles everything;
- checks the result fits Google Earth's import limits.
DWG ──LibreDWG dwg2dxf──▶ DXF ──GDAL + dxf2kmz.py──▶ KML ──zip──▶ KMZ
- Finds the CRS for you: reads the georeference embedded by Civil 3D (
UTM84-36S→ EPSG:32736), or takes--epsg. Includes notes on UTM zones and Arc 1960 vs WGS 84 for East Africa. - Real polygons: closed polylines become polygons with area in hectares, and hatches become filled areas. Contours, pipes and roads stay lines.
- Fixes messy drawings: snaps boundaries drawn as separate pieces into one polygon (
--join-layers). Removes duplicates, sheet frames, title blocks and dimensions, and repairs invalid polygons. - Readable in Google Earth: folders by theme → CAD layer, colours from the drawing, and labels as names. Block inserts (valves, pumps…) become symbols, and contours are hidden by default.
- Fits import limits: simplifies invisibly (0.5 m) and warns above Google Earth's 250k-vertex / 10k-feature "Import as map features" limits.
- Honest report: prints JSON covering:
- the source CRS and why it was chosen;
- features per layer;
- everything skipped or joined, and why;
- the WGS 84 bounding box;
- the vertex count.
git clone https://github.com/silaselisha/Cad2earth.git && cd Cad2earth
bash scripts/qgis-python.sh scripts/dxf2kmz.py examples/sample.dxf sample.kmz --epsg 32736 --join-layers '^FARM BOUNDARY$'Open sample.kmz in Google Earth: a made-up 1,400 ha estate near Kericho, Kenya. Or download examples/sample.kmz directly.
git clone https://github.com/silaselisha/Cad2earth.git ~/.claude/skills/cad2earthThen, in any Claude Code session, ask, e.g., "convert Desktop/ESTATE BOUNDARIES.dwg to kmz". Claude follows SKILL.md:
- inspect the drawing;
- work out the CRS;
- convert;
- verify the location on satellite imagery;
- report what could not be converted.
| Windows | Debian / Ubuntu | macOS | |
|---|---|---|---|
| GDAL + Python | QGIS (bundled) | sudo apt install python3-gdal |
brew install gdal && pip install gdal==$(gdal-config --version) |
| DWG → DXF | bash scripts/get-libredwg.sh tools/libredwg (portable download) |
sudo apt install libredwg-tools |
brew install libredwg |
| Shell | Git Bash | bash | bash |
Only DXF input? You don't need LibreDWG.
DWG2DXF=$(bash scripts/get-libredwg.sh tools/libredwg) # Windows: downloads; Linux/macOS: finds it on PATH
"$DWG2DXF" -y -o in.dxf in.dwg
bash scripts/qgis-python.sh scripts/inspect_dxf.py in.dxf # units, extents, embedded CRS, geometry per layer
bash scripts/qgis-python.sh scripts/dxf2kmz.py in.dxf "Out.kmz" --kml| Option | Default | Purpose |
|---|---|---|
--epsg N |
from the drawing | source CRS (projected, metres) |
--join-layers RE |
none | layers whose open pieces form one boundary ring |
--snap M |
40 | max gap (m) snapped when joining |
--line-layers RE |
contour, pipe, road, stream… | closed shapes on these layers stay lines |
--hidden-layers RE |
0, elevation, contours |
exported but switched off |
--skip-layers RE |
Defpoints |
left out |
--simplify M / --simplify-hidden M |
0.5 / 2 | simplification in metres |
--far M |
100000 | drop details drawn far from the map (e.g. at the origin) |
--kml |
off | also write the plain .kml |
- Google Earth Pro: File → Open (not Import).
- Google Earth web: Projects → Import KML → "Import as map features". The report warns if the file is over the limits; otherwise use "Import as a data layer".
- QGIS, ArcGIS, Google My Maps also read KMZ.
