GeoConvert
Resources

Convert DXF to KML: fix coordinate systems and units

Updated · 9 min read

To place DXF geometry correctly in KML, identify the drawing’s real source CRS and units, then transform its coordinates to WGS 84 longitude/latitude. DXF model coordinates alone cannot identify an EPSG code. If the drawing is local or unreferenced, georeference it before conversion; choosing EPSG:4326 does not make arbitrary CAD coordinates geographic.

Try the converter →

Identify the source CRS before converting

Ask the surveyor or drawing author for the CRS identifier, datum, coordinate units and at least one known control point. An EPSG code distinguishes a geographic system from a projected system and can also distinguish otherwise similar regional definitions. A drawing location, layer name or unit flag alone is insufficient.

Coordinate ranges are clues, not proof. Values around longitude 12 and latitude 45 could be degrees; values near 1.3 million and 5.6 million could be projected meters. Many projected and local systems overlap numerically. Confirm the system against metadata and known points instead of selecting a code that makes the map look plausible.

A project drawn around [0,0] may use a local origin and rotation. It needs a documented transformation using control points before it can be mapped globally. A local-to-global transformation is not obtained by simply assigning a familiar EPSG code.

Distinguish unit errors from CRS errors

DXF units describe model distances. Millimeters, meters, international feet and US survey feet are not interchangeable. A scale error is separate from a missing CRS. GeoConvert does not infer a geographic CRS from $INSUNITS and does not provide a separate drawing-unit correction step.

For example, 1,000 millimeters represents one meter; interpreting those numbers as meters produces a factor-of-1,000 error. An international foot is exactly 0.3048 meters, while a US survey foot is 1200/3937 meters. The small difference between the two foot definitions can matter in large survey coordinates.

When the numeric model units differ from the intended CRS units, correct them in CAD/GIS with the drawing author’s documented origin and scale. Do not multiply global coordinates blindly: survey origins, false eastings and local offsets must be treated consistently. An EPSG transformation cannot repair a wrongly scaled drawing.

Convert a referenced DXF to WGS 84 KML

KML stores longitude, latitude and optional altitude in WGS 84. GeoConvert forces KML output to that geographic system, so the source CRS must accurately describe the input numbers. For unreferenced DXF with no user-supplied source CRS, the engine can assume EPSG:4326 with a warning; this is not evidence that the drawing actually uses degrees.

The web-mercator-meters.dxf sample has two synthetic Point entities encoded in EPSG:3857 meters. Use source EPSG:3857 for this sample only. Its intended transformed positions are [0,0] and [1,1]; the sample is a controlled projection exercise, not a recommended survey CRS.

  1. Open the DXF to KML tool linked on this page and add an ASCII DXF.
  2. Expand conversion options and set the source CRS to the verified EPSG code. For the supplied meter-based Web Mercator sample, select EPSG:3857.
  3. Choose KML output. Its effective target is WGS 84 / EPSG:4326; do not label projected input as EPSG:4326 to avoid a transformation.
  4. Run the conversion, read warnings and download the KML. Resolve source-CRS assumptions and unsupported entity errors before using the result.
  5. Open the KML in Google Earth or QGIS and perform the numerical and location checks below.

Verify the result with coordinates and control points

Inspect a coordinates element in the KML. Longitude comes first, followed by latitude and optionally altitude. Values outside normal geographic longitude/latitude ranges are a strong warning that projected numbers were not transformed correctly. Values within those ranges can still be wrong because many incorrect locations are numerically valid.

For the supplied sample, compare the two output positions with [0,0] and [1,1], allowing for numeric rounding. The automated Node WASM fixture check produced two points at [0,0] and [1,1] with Layer values DEMO_1 and DEMO_2. Without a source CRS, the same fixture completed with an EPSG:4326 assumption warning and an invalid latitude of 111325.142866385 for its second point. This is direct evidence that a completed conversion is not a position check. Check the feature count and CAD layer names as well. For real survey data, compare independent control points with a trusted reference in the appropriate local CRS; a basemap may have its own positional uncertainty.

Check separation and scale as well as location. One point can line up while the drawing remains rotated or scaled incorrectly. Use several control points spread across the drawing and a documented distance. Horizontal CRS transformation does not by itself certify vertical datum, altitude units or Google Earth altitudeMode behavior.

Diagnose common wrong-location symptoms

Features near the equator or origin: confirm that the CAD coordinates are georeferenced and that the source CRS was supplied. A blank or rejected result with very large coordinates can indicate meters being treated as degrees. Shifted features can indicate a wrong UTM zone, hemisphere, datum, axis interpretation or local offset.

A correct-looking location with the wrong size often points to unit scaling, while a drawing that is rotated or displaced inconsistently may require local georeferencing. A longitude/latitude swap is another distinct problem: inspect numeric axes before changing CRS.

Re-run from the original DXF after fixing the cause. Reprojecting an already incorrect KML compounds the uncertainty because it has already labeled its numbers as WGS 84. Record the source EPSG, units and control-point evidence with the deliverable.

Understand the browser’s CAD support limits

GeoConvert supports a bounded ASCII DXF subset: points, lines, polylines, arcs, circles, SOLID/3DFACE and straight-edged HATCH boundaries. Arcs, circles and polyline bulges are approximated with finite vertices and produce a warning. Check whether that approximation meets your application’s precision needs.

TEXT/MTEXT, INSERT and block-contained geometry, RAY/XLINE, ELLIPSE/SPLINE, binary DXF and unknown or incomplete entities are rejected by this browser workflow. The capabilities of an installed desktop GDAL release can be broader; its documentation is not a promise that every entity is supported here.

Prepare a geometry-only export in CAD when necessary, preserving the verified coordinate values. Do not silently remove required labels or blocks to force a conversion through. CAD layers can transfer as feature information, but DXF is not an arbitrary GIS attribute table and KML is not a faithful CAD drafting replacement.

Sample files

Frequently asked questions

Can DXF tell the converter which EPSG code to use?
The model coordinates and unit information are insufficient to infer a CRS. Obtain the source CRS from the drawing author or survey metadata and confirm it using control points.
Should I choose EPSG:4326 for all DXF to KML conversions?
Only use EPSG:4326 as the source when the DXF numbers already are WGS 84 longitude and latitude in degrees. The output is WGS 84, but projected or local input must first be described and transformed correctly.
Why is my KML drawing the wrong size?
Check drawing units and the source CRS units, including meters versus millimeters and the exact foot definition. Unit scaling and local georeferencing may need correction before reprojection.

Related guides and conversions

Sources