DXF vs SHP — Which Is Better for Geodata?

DXF is the CAD exchange format (AutoCAD), Shapefile is the desktop GIS standard (ArcGIS, QGIS). Both support geodata but come from different worlds.

Criteria DXF Shapefile
CAD software✓✗
GIS software✗✓
Attributes✗✓
Geometric precision✓✓
Projections (CRS)✗✓

When to use DXF

For AutoCAD, master plans, engineering drawings, land surveying.

When to use Shapefile

For ArcGIS, QGIS, data analysis, government GIS systems.

What is DXF?

Example OpenStreetMap map exported to DXF
DXF: an OpenStreetMap map exported by osm2cdr.

DXF (Drawing Exchange Format) was published by Autodesk in 1982 together with early AutoCAD as an openly documented way to move drawings between programs. Autodesk still publishes a reference for each release, so almost every CAD, CAM and GIS package reads it.

A DXF file is organised into sections: a header, tables for layers, line types and text styles, a blocks section and an entities section with lines, polylines, hatches and text. Geometry is stored as raw X, Y and Z values in drawing units, and recent versions can add a GEODATA object that ties the drawing to a coordinate system.

Software that opens DXF

AutoCAD and AutoCAD LT, BricsCAD, NanoCAD, KOMPAS-3D, FreeCAD and LibreCAD open DXF directly, and so do QGIS, Global Mapper and most laser-cutter and CNC software.

Where DXF is strong

Reach is its main strength: when you do not know which program the recipient uses, DXF is the safest bet. Because it is text, it can be inspected or generated by scripts, and layers, colours, line types and blocks survive the trip between applications.

Limitations of DXF

Text encoding makes files several times larger than the equivalent DWG, so big drawings load slowly. Newer AutoCAD-only objects may be simplified by other programs, and many programs ignore the GEODATA object, so the receiver may still need to be told which coordinate system was used.

What osm2cdr puts into a DXF file

osm2cdr writes a text DXF (version R2007) with the map split into named layers — roads, buildings, water, green areas, boundaries and points of interest — keeping colours and line types. By default the drawing is in metres in the UTM zone of the area, or in the national grid where one exists, so it can be measured right after opening; a GEODATA object records the system, and an explicitly chosen one adds a .prj in a ZIP.

What is Shapefile?

Example OpenStreetMap map exported to Shapefile
Shapefile: an OpenStreetMap map exported by osm2cdr.

The shapefile was introduced by Esri in the early 1990s with ArcView GIS, and Esri published its technical description in 1998. It is not a formal standard, yet three decades of use have made it the most widely accepted exchange format in desktop GIS.

A shapefile is a set of files sharing one base name: .shp holds the geometry, .shx an index into it, .dbf the attribute table in dBASE format, .prj the coordinate system and .cpg the text encoding. Each shapefile stores exactly one geometry type — points, lines or polygons.

Software that opens Shapefile

ArcGIS, QGIS, MapInfo, Global Mapper, GRASS GIS, GeoPandas, PostGIS (through shp2pgsql) and GDAL read and write shapefiles, and AutoCAD Map 3D and many surveying packages import them.

Where Shapefile is strong

Support is universal and fast, the structure is simple to implement, and public agencies and contractors routinely request it. The attribute table opens even in tools that know nothing about geometry but understand dBASE.

Limitations of Shapefile

Field names are capped at ten characters, text fields at 254 characters and each component file at 2 GB. One geometry type per file means a map becomes several shapefiles, and losing a companion file breaks the dataset.

What osm2cdr puts into a Shapefile file

osm2cdr delivers a ZIP in which every layer — roads, buildings, water, greenery, points of interest — sits in its own folder as a complete .shp, .shx, .dbf and .prj set, with a README describing the contents. OpenStreetMap attributes are written in UTF-8, and coordinates are WGS 84.

Key differences explained

At the most basic level, DXF is an openly documented CAD drawing exchange format, while Shapefile is a multi-file vector format created by Esri. On disk, DXF is usually plain ASCII text, which makes files large but readable; Shapefile is binary geometry files plus a dBASE attribute table.

Here is what the comparison table above means in practice, point by point:

Example OpenStreetMap map exported to DGN
A related export: the same kind of map in DGN, a format often used next to DXF.

In short: choose DXF when the drawing has to open in any CAD, CAM or GIS program, including ones you do not know in advance. Choose Shapefile when the data goes into a desktop GIS workflow or to an agency that asks for shapefiles.

DXF or Shapefile: which one fits your job?

A surveyor needs a base drawing for a topographic plan in CAD. DXF gives named layers and metric coordinates that fit drafting habits and title blocks.

A GIS analyst wants to join building footprints with census or cadastre data. Shapefile carries OSM attributes in a table, which DXF cannot hold in a usable form.

You import data into a CAD-GIS hybrid such as AutoCAD Map 3D or QGIS. Both formats work there; choose by whether attributes or drawing structure matter more for the task.

Pitfalls when switching between DXF and Shapefile

Converting a shapefile to DXF drops the attribute table, so building type or name survives only as layer names or text at best. Converting DXF to shapefile requires splitting entities by geometry type, and blocks, hatches and text do not become meaningful features. Coordinates differ as well: osm2cdr's shapefile is in WGS 84 degrees, while its DXF is in metres in a UTM zone or a national grid, so overlaying them needs reprojection.

Many teams need both: the CAD department works on the DXF while the GIS department keeps the shapefile with attributes as the reference dataset. Exporting both for the same area from osm2cdr gives each team a native file without a lossy conversion between them.

Which to pick on osm2cdr

On osm2cdr, pick DXF for drafting and CAD-based design. Pick Shapefile when you need attributes, spatial analysis or delivery into a GIS department.

How to get DXF or Shapefile from OpenStreetMap

osm2cdr builds DXF and Shapefile directly from OpenStreetMap data — there is no need to download raw OSM extracts or install conversion tools. The steps:

  1. Open the osm2cdr map for DXF and find your place by name, or draw a rectangle around the area.
  2. Choose DXF or Shapefile in the format list and set the options offered for it, such as map layers, style or sheet size.
  3. Start the export and download the result: DXF arrives as a .dxf file, or a ZIP with the .dxf and a .prj when you pick a coordinate system yourself; Shapefile arrives as a ZIP with one folder of .shp, .shx, .dbf and .prj files per layer.
  4. Need Shapefile as well as DXF? Run a second export of the same area. Both start from the same OpenStreetMap data, but each keeps only what its format can hold, as described in the sections on DXF and Shapefile above.

Converter pages related to DXF and Shapefile explain each route in more detail:

Frequently asked questions

What is the main difference between DXF and Shapefile?

DXF is an openly documented CAD drawing exchange format, whereas Shapefile is a multi-file vector format created by Esri. In the comparison table, DXF is ahead on CAD software; Shapefile is ahead on GIS software, attributes and projections (CRS).

Which is better for CAD software, DXF or Shapefile?

DXF. Reach is its main strength: when you do not know which program the recipient uses, DXF is the safest bet.

When does Shapefile beat DXF?

When GIS software, attributes and projections (CRS) matter most. Support is universal and fast, the structure is simple to implement, and public agencies and contractors routinely request it.

Can I convert DXF to Shapefile?

Yes. osm2cdr has a dedicated DXF to Shapefile converter page for existing files. If you are starting from OpenStreetMap, export the area straight to Shapefile instead.

Which programs open DXF and Shapefile files?

DXF files open in AutoCAD, BricsCAD, NanoCAD, KOMPAS-3D, FreeCAD, LibreCAD and QGIS. Shapefile files open in ArcGIS, QGIS, MapInfo, Global Mapper, GRASS GIS and PostGIS.

Do DXF and Shapefile keep real-world coordinates?

DXF can carry its coordinate system: osm2cdr writes a GEODATA object into the drawing and by default uses metres in the UTM zone of the area or a national grid; if you pick a system explicitly, a .prj file comes with the drawing in a ZIP. Shapefile keeps its coordinate system in the .prj companion file; osm2cdr writes WGS 84 (EPSG:4326) with a matching .prj for every layer.

Export to DXF Export to Shapefile