How to Convert a DXF to a Shapefile (CAD to GIS)
A DXF and a Shapefile can hold the same lines, but they are built for different jobs. DXF is a drawing: entities on layers, with blocks, text and hatches, and no idea where on Earth it sits. A Shapefile is a GIS layer: one geometry type per file, an attribute table, and an optional coordinate system. Converting one into the other means splitting the drawing by geometry, deciding what becomes an attribute, and attaching a coordinate system the DXF never had. Here is what carries over, what does not, and how to do it offline.
Why a DXF does not map one-to-one onto a Shapefile
A Shapefile stores exactly one kind of geometry — points, lines or polygons. A DXF mixes them freely on the same layer. The first thing any conversion does is sort the drawing into up to three files, one per geometry type.
A Shapefile also carries an attribute table (.dbf) and, optionally, its coordinate system (.prj). A DXF has neither in that form: its "attributes" are the layer name and whatever the entity type implies, and it declares no coordinate system at all.
What carries over — and what does not
Geometry carries over: points, open lines and closed outlines become points, polylines and polygons. Elevations can carry over too, if the Shapefile is written in 3D (PointZ, PolyLineZ, PolygonZ) rather than flat.
Identity carries over as attributes: the object's name and the DXF layer it came from become fields in the table, so the layer structure survives as a column you can filter on.
Drawing style does not: text, block symbols, hatch patterns, colours and line types are presentation, and a Shapefile stores geometry and attributes only. Shapefiles also have no true curves, so check arcs and circles after any conversion — they have to become a chain of vertices.
The coordinate system is the step people miss
The coordinates in a DXF are real numbers — often a national grid or UTM — but the file does not say which system they are in. A Shapefile without a .prj has the same problem, and a Shapefile with the WRONG .prj is worse: it lands confidently in the wrong place.
So the conversion is the moment to attach the system the drawing was made in. That is an assignment, not a transformation: the numbers stay the same, only their meaning is declared. If the system cannot be identified unambiguously, it is better to write no .prj than a guessed one.
Step by step in STREAM
1. Work in a project whose coordinate system is the one the drawing was made in.
2. Import the DXF. Its layers come with it; a layer with very many objects loads read-only for speed — right-click it and choose Make Editable so its objects can be exported.
3. Hide what you do not want in the output. Only visible objects are exported.
4. Open Map Output and choose Shapefile. STREAM writes a separate 3D Shapefile for points, lines and areas, skips a type that has no objects, and puts each object's name and layer in the attribute table. Measurements go out too: area measurements with the polygons, the others with the lines.
5. The .prj is written when the project's coordinate system resolves to an EPSG code; otherwise the file is left without one rather than with a guess.
6. Open the result in your GIS and check three things: the layer lands where it should, the attribute table has the layer names you expect, and the Z values are there.
Going the other way: Shapefile to DXF
The reverse works the same way. Import a Shapefile, GeoJSON or GeoPackage — every layer becomes a layer and every feature an object you can draw on, snap to and edit — then export DXF, and the layers go with it.
Frequently asked questions
Why does converting one DXF give me several Shapefiles?
Because a Shapefile holds only one geometry type. Points, lines and polygons from the same drawing go into separate files; a type with no objects is skipped.
Why does my converted Shapefile have no coordinate system?
Because a DXF does not declare one. Attach the system the drawing was made in — an assignment, not a transformation. STREAM writes the project's system as a .prj when it resolves to an EPSG code, and writes no .prj rather than a guessed one.
Does the conversion keep elevations?
It can, if the Shapefile is written in 3D. STREAM writes PointZ, PolyLineZ and PolygonZ files, so the Z of every vertex comes along.
What happens to DXF text, blocks and hatches?
They are drawing presentation, not GIS geometry, and are not written to the Shapefile. The object's name and its DXF layer are kept as attributes.
Can I convert a Shapefile back to DXF?
Yes. Import the Shapefile, GeoJSON or GeoPackage, then export DXF; each GIS layer becomes a DXF layer.
Convert between CAD and GIS formats in STREAM
Native Windows · fully offline · free beta