Is it at all possible generate a digital elevation model raster from CAD contour polylines with elevations?

I am using straight AutoCAD 2014, not Map3D or Civil3D.

I was able to bring the dxf of the contours into QGIS, but was not able to get the elevations into the attribute table.

If I could get the elevations to transfer as an attribute, I think I could create the DEM from that, but as of now, I'm stuck at the polyline layer with no elevation attribute.

Any thoughts on how to get attributes to transfer from the CAD file, and convert the lines?

  • does the CAD contour lines have any attributes indicating elevation? or is it just a textual information placed next to the line?
    – vinayan
    Jul 9, 2014 at 7:34
  • It is possible, but the steps depend on your CAD data. I know you say you're not using Civil or anything, but how were the lines created? If they were drawn planar (ie, they have no z value) then you can use CAD (or GIS for that matter) to move the lines to their appropriate elevation. If they already have a z value, the dxf shouldn't flatten them. You may not have an elevation attribute, but the geometry should have elevation. This may depend on whether the GIS file you're bringing the data in to is 3D or not.
    – Chris W
    Jul 9, 2014 at 19:32

2 Answers 2


I came across this question, which boils down to your problem. Maybe you can try the suggested tool (dxf2xyz 2.0) to convert your DXF to xyz? The free tool apparently only supports AutoCAD version up to 2002, thus not suitable in your case. However, I found another tool allowing to convert between DXF versions (R1.X to 2018) (including yours). The trial version seems to be full-featured, but limited to 15 uses.

I know it's a somehow cumbersome way of doing something which is intrinsically easy, but you should give it a shot... Use the desired tool to convert DXF to readable formats.

  • Thanks for the tip. Looks like Guthrie CAD, maker of dxf2xyz had a newer tool CAD2Shape 7, which allowed me to export the contours into a point shapefile with elevations as an attribute...which I then interpolated into a DEM. I'm happy! Jul 15, 2014 at 21:31

There might be other ways of doing it by now, but I found the most convenient way of converting from DXF to SHP (saving the DXF elevations as shapefile attributes) was to use gvSIG.


  • Thanks - I tried using gvSIG (which I had not used before) without success. When I tried to add the DXF or DWG it gave me an error that looked Java related. Cool open source program though...I will continue to experiment with it. Jul 15, 2014 at 21:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.