This question already has an answer here:

I'm trying to export contour lines from QGIS into standard AutoCAD but I'm not having much luck.

It does not seem to matter what type of file I select as the output during the contour creating (eg. DXF or CSV) all I get is a folder containing 3 files (an SHX,a compiled shape source file and a DBF file all titled as contour. I am then unable to open these files in AutoCAD.

If I then export the contour lines from QGIS as a DXF that file will open in AutoCAD but the lines appear to be missing their Z property.

Is there a simple way to export contours from QGIS that retains their xyz information?

marked as duplicate by Evil Genius, Mapperz Sep 3 '15 at 14:01

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


It looks like the output is always created as a shapefile by default. Some tools don't allow all data types that QGIS normally supports. In the Contours dialogue, you can set the format manually according to http://www.gdal.org/gdal_contour.html by selecting the pencil icon:

gdal_contour -f "DXF" -a ELEV -i 100.0 D:/Karten/SRTM/N51E007.hgt D:/Download/test.dxf

You get a DXF file with this command, but the DXF driver throws a warning that it can not create a data field named ELEV

Alternatively, you can save the resulting layer with Rightclick -> Save as ... and change the file type from ESRI Shapefile to DXF, or use Project -> DXF Export.

From reading of http://www.gdal.org/drv_dxf.html, I am not sure how the elevation data can be stored in DXF format.

This question DXF attribute to z value might be interesting for you, but I have no Autocad running to see if it exports successfully.

There is a ticket for it too: https://hub.qgis.org/issues/7327, and https://hub.qgis.org/issues/6695 for the format issue.

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