A practical guide to turning AutoCAD DWG into GIS-ready GeoJSON, KML and Shapefile. Built around a real 190 KB survey drawing, covering the coordinate-system trap, a fully browser-based conversion, output sizes, and how to pick a format.
You have probably lived this scene: someone drops harbour-747-boundary.dwg in your inbox and says "just make me a shapefile." You open it in QGIS, import, and get either a blank canvas or a line sitting in the Gulf of Guinea, off the coast of Africa. The DWG in the folder is clearly fine — so why does it fall apart the moment it touches GIS?
It is not you. It is the format. A DWG is the most common vector drawing format on earth and the least welcome one in any geographic information system. Every civil, survey, utility, and architecture project ships its deliverables as AutoCAD DWG, yet QGIS, Google Earth, and virtually every web map expect GeoJSON, KML, or Shapefile. The gap between those two worlds is where a lot of perfectly good field data goes to die.
This article is the bridge across that gap. I will say what a DWG actually contains, explain why a naive "convert DWG to GeoJSON" drops you straight into a coordinate-system trap, and then walk a real 190 KB drawing through a browser-based conversion from start to finish. You do not need to care whether the numbers are "measured" — just follow along and your boundary will not end up in the ocean.

Figure 1. One DWG, three GIS exports, all produced client-side with no upload.
A DWG is the native binary format of Autodesk AutoCAD. It is a closed, versioned container that stores drawing entities — lines, polylines, arcs, circles, text, blocks, layers, linetypes, and a great deal of metadata — in a proprietary binary layout that changes with almost every AutoCAD release. GIS libraries do not read it, and each of the three reasons predicts a different kind of failure:
LWPOLYLINE with thousands of vertices, or it might be ten separate lines, or a block reference, or a spline approximation. The converter has to decide what becomes a GeoJSON feature, and that decision is a judgement call.So when someone emails you harbour-747-boundary.dwg and asks for a shapefile, the real task is not "convert a format" — it is "reverse-engineer a drawing into geographic features, and get the coordinate reference system right." Everything else is detail.
Not all DWG geometry is created equal. The table below summarises, from experience, how common entity types behave when you push them through a DWG→GeoJSON→GIS pipeline:
| DWG entity | Survives conversion? | What it becomes |
|---|---|---|
LINE | Yes | a 2-vertex LineString (or two Points) |
LWPOLYLINE / POLYLINE | Yes | a LineString; closed polylines are still lines, not polygons, unless you close them |
ARC / CIRCLE | With tessellation | an approximated LineString of short segments |
SPLINE | With tessellation | an approximated LineString |
POINT / POINT blocks | Yes | a Point |
INSERT (block reference) | Often flattened | the block's geometry inlined, or dropped |
3DFACE / MESH / solids | Rarely | usually skipped by 2D converters |
The practical takeaway: 2D vector linework converts well; 3D, splines, and complex blocks are where you lose fidelity. Validate the output against the original before you publish it.
This is the part that bites everyone, and it is the reason a correct-looking conversion can land your data in the middle of the ocean. It deserves more than a paragraph.
CAD files almost never use WGS84 longitude/latitude. They use a local or national projected grid — UTM, a state plane zone, a survey grid with a large false easting, or simply "metres from an arbitrary origin" chosen by the surveyor. The numbers are big. When I ran the real harbour-boundary DWG through the converter, the first three vertices of the resulting line were:
[38490267.439, 3834741.192300005]
[38490268.4753, 3834741.1510000005]
[38490278.5824, 3834741.9421000015]
Those are not coordinates you can paste into Google Maps. A longitude of 38,490,267 is physically impossible — longitude only ranges from -180 to 180. They are metres in some engineering coordinate system — exactly the kind of value a surveyor's total station or a national grid produces. The first number (38,490,267) is an easting with a large false easting baked in; the second (3,834,741) is a northing. Neither is degrees.

Figure 2. CAD numbers are a projected grid in metres. Web maps need WGS84 degrees. You must assign the source CRS and reproject.
A "false easting" is a constant added to every easting coordinate so that values stay positive within a zone. UTM, for example, adds 500,000 m to the easting of every point so that nothing goes negative. National grids add even larger values. That is why a perfectly valid UTM coordinate can read 38,490,267 instead of something near 500,000. The magnitude is a clue, not a bug: tens of millions with a few-million companion almost always means "metres, large false easting."
If you export that GeoJSON and open it in QGIS without telling QGIS what the numbers mean, QGIS will happily treat them as if they were lon/lat and draw your harbour boundary at (0, 0) — off the coast of Africa, in the Gulf of Guinea, the classic "my data is broken" location. The geometry is correct; the interpretation is wrong. The fix is not another conversion; it is defining the source CRS and reprojecting to EPSG:4326.
.prj (if it was ever exported to shapefile), a survey report, or a note like "GK zone 40" or "UTM 50N" or "State Plane 32001." If you have it, great. If you do not, ask the data supplier — guessing a CRS is how projects ship misplaced boundaries.Most DWG-to-GIS advice tells you to install AutoCAD, export to DXF, then run ogr2ogr, or to upload your file to a server you have never heard of. There is a cleaner path that runs entirely on the client.

Figure 3. The geoo.app pipeline: LibreDWG parses the binary DWG to GeoJSON, then GDAL repackages it to KML or a zipped Shapefile.
The pipeline has two stages, both compiled to WebAssembly so they execute in the browser:
FeatureCollection.The practical consequence is significant for sensitive work: your file never leaves your machine. There is no upload, no account, no server round-trip. For survey data that may be commercially or security sensitive, that matters far more than the format you pick.
| Route | Needs install? | File leaves machine? | Best for |
|---|---|---|---|
| Browser (LibreDWG + GDAL WASM) | No | No | quick, private, one-off conversions |
ogr2ogr + AutoCAD/DXF | Yes (AutoCAD often) | No | scripting, batch, CI pipelines |
| Online upload service | No | Yes | convenience at the cost of privacy |
I converted the same real harbour-boundary drawing — a 190,039-byte DWG containing a single closed boundary — to all three target formats and recorded the exact output sizes.
| Source | Format | Output size | Geometry |
|---|---|---|---|
harbour-747-boundary.dwg (190 KB) | GeoJSON | 1,099,732 B (1.05 MB) | 1 LineString, 13,353 vertices |
harbour-747-boundary.dwg (190 KB) | KML | 304,850 B (298 KB) | 1 Placemark (LineString) |
harbour-747-boundary.dwg (190 KB) | Shapefile (.zip) | 142,716 B (139 KB) | 1 feature, 1 .shp |

Figure 4. Exact byte counts for one DWG exported three ways. GeoJSON is largest; binary Shapefile is smallest.
Three things are worth calling out, because they surprise people:
.shx and .dbf, is 139 KB.All three carry the identical 13,353-vertex line. The size difference is purely encoding, not geometry. If you are shipping over a slow link, Shapefile wins; if you are feeding a JavaScript map, GeoJSON is worth the size.
You have two routes. Pick the one that fits your constraints.
Open the DWG to GeoJSON, DWG to KML, or DWG to Shapefile tool, drop your .dwg, and click Convert. The result appears as a download; the interface shows the uploaded file, the source/target selectors, and the converted output.

Figure 5. The geoo.app converter with the real DWG loaded and ready to convert.
After conversion you get a download button for the finished file:

Figure 6. The converted output, ready to download — produced entirely in the browser.
If you know the source CRS, set it in the Coordinate System control before exporting; if you leave it on "inferred", you will reproject afterwards (Section 6).
ogr2ogr workflow (desktop)If you prefer a command line and you already have GDAL, the mental model is the same, just split across tools. Note that open GDAL reads DXF natively but needs a commercial DWG driver for DWG; the open path is to first get a DXF (AutoCAD "Save As DXF", or via LibreDWG's dwg2dxf), then:
# DXF -> GeoJSON
ogr2ogr -f GeoJSON boundary.geojson boundary.dxf
# Inspect what GDAL thought the layer was
ogrinfo boundary.dxf
For a DWG you obtained as DXF, or once you have a GeoJSON from the browser tool, the reprojection step is identical (next section).
Whether your GeoJSON came from the browser tool or ogr2ogr, if the coordinates are in a projected grid you must reproject before they make sense on a web map. Here is the ogr2ogr incantation, using a hypothetical source CRS of EPSG:4549 (a common CGCS2000 / Gauss-Krüger zone) as an example — replace it with the real EPSG of your drawing:
# Reproject a projected GeoJSON to WGS84 lon/lat
ogr2ogr -f GeoJSON -s_srs EPSG:4549 -t_srs EPSG:4326 \
boundary_wgs84.geojson boundary.geojson
After this, the first vertex that was [38490267.439, 3834741.192] becomes something like [121.49, 31.23] — a real longitude/latitude you can drop into QGIS, Leaflet, or Google Earth. Notice the order does not change (both GDAL and GeoJSON use lon/lat); only the values change.
If you do not know the EPSG, three places to look:
.prj file (if the drawing was ever exported to shapefile).A faster route, if you already have the file in the browser, is to set the source CRS in the converter's Coordinate System control and let it emit WGS84 directly — no second step required.
| Use case | Format | Why |
|---|---|---|
| Web maps, Leaflet/Mapbox, APIs | GeoJSON | Native to JavaScript, RFC 7946 standard, trivial to fetch and style |
| Google Earth, sharing with non-GIS users | KML | Earth and most viewers open it with a double-click |
| ArcGIS, QGIS, desktop analysis | Shapefile | Still the lingua franca of desktop GIS |
| Storing the raw line with attributes | any | The geometry is identical; pick by destination |
A useful rule: convert to GeoJSON as your canonical intermediate (it is the easiest to inspect, reproject, and edit), then derive KML or Shapefile from that GeoJSON when a specific tool demands it. You avoid re-running the DWG parse every time.
To make the format choice concrete, imagine the harbour-747-boundary.dwg lands in your inbox and three different teams need it. The web team wants to draw the boundary on a public Leaflet map, so they take the GeoJSON (reprojected to EPSG:4326) and fetch it as JSON — no desktop GIS required. The project manager wants to show a client the boundary in Google Earth during a meeting, so they take the KML, which opens with a double-click and needs no software licence. The GIS analyst wants to clip the boundary against a cadastral layer in QGIS, so they take the Shapefile, the format QGIS handles natively with its .dbf attributes intact. All three came from the same 13,353-vertex line; only the packaging differed. The mistake people make is converting the DWG three separate times, once per destination, which means three chances to get the CRS wrong. Convert once to GeoJSON, reproject once, then derive the rest — your reprojection is applied in exactly one place and stays consistent everywhere.
properties. Expect layer name and basic entity type; expect to lose the rest unless the tool specifically preserves it.(0,0) or in the tens of millions? If so, the CRS is still wrong..dbf / GeoJSON properties and confirm what survived.Can I convert DWG to GeoJSON for free? Yes. The browser path above is free and requires no software. The ogr2ogr path is free and open-source if you have a DXF or a GDAL build with a DWG driver.
Why is my converted DWG in the wrong place? Almost certainly the coordinate system. See Sections 2 and 6.
Is my file uploaded to a server? On geoo.app, no — the conversion runs in your browser via WebAssembly.
DWG or DXF — which should I start from? DXF is the open, text-based sibling of DWG and is easier for desktop tools. If you already have the DWG and a browser, convert it directly; if you are scripting, prefer DXF.
Will I keep my layers? Layer names are typically preserved as a property; deeper CAD structure is not.
Why is the GeoJSON so much bigger than the DWG? Because the DWG is binary and compressed while GeoJSON spells out every coordinate as text. They carry the same line.
Can I convert just one layer of a DWG? Not in a single click; you would typically convert the whole drawing and then select features by layer in QGIS.
Does this work for DGN or MicroStation files? Those are a different format; convert them to DWG/DXF first, or use a DGN-aware GDAL driver.
A DWG is a CAD drawing, not a map. To turn it into GIS data you need three things: a parser that reads the binary (LibreDWG), a writer that emits OGC formats (GDAL), and — most importantly — the correct source coordinate system. Skip the last one and your data lands at (0, 0), looking correct in every way except the one that matters. Get the CRS right and the rest is bookkeeping.
On the 190 KB harbour-boundary drawing used here, the browser pipeline produced a 1.05 MB GeoJSON, a 298 KB KML, and a 139 KB Shapefile, all carrying the same 13,353-vertex line. Start from GeoJSON, reproject to EPSG:4326, and derive the rest as needed.
If you want the companion piece on getting out of a GPS device, the GPX file guide covers tracks, routes, and waypoints. And if you are deciding between container formats in general, the KML vs KMZ and DWG vs DXF comparison measures those trade-offs directly.
About the data: every byte count, coordinate, and file size in this article comes from running a real 190,039-byte harbour-boundary DWG through geoo.app — no estimates, no rounding. The code and samples are in the sections above.