I have a .tiff data file that generates contours in QGIS. I save it as .dxf. The contours don't have any attributes or data. That's bad, because I want to make a 3D landscape in Revit using the information.

How do a save/export the contour lines from QGIS so that they have a z-elevation attribute or at least some information?

I ticked the attributes box when extracting the contours, but the attributes doesn't show in the dxf.

  • Note that my answer was revised to address missing attributes. If that (or any other) answer solves your problem, please mark it as the correct answer.
    – Scro
    Commented Jan 28, 2014 at 15:35

1 Answer 1


When you generate the contours in QGIS, make sure that you tick the Attribute name box. Then when you ogr2ogr (you must use command line - this is not an option in QGIS Save AS), specify the zfield. For example, if your elevation attribute is "ELEV", then your command could look something this:

ogr2ogr -f "DXF" contours-out.dxf contours.shp -zfield ELEV

By the way, if you were searching for this in answers, you would not have found it. I learned this method from this question.

EDIT: I should also point out that the DXF will not have an attribute field for elevation, but instead will be drawn to elevation.

  • ogr2ogr? I am on a mac..
    – QGisRookie
    Commented Jan 24, 2014 at 21:59
  • Well, that would be another question. It's well documented. You're looking for the GDAL command line utilities.
    – Scro
    Commented Jan 24, 2014 at 22:57
  • 1
    I was really surprised to find out that this is the only way which worked for me. Though the command itself comes naturally with errors it can't create fields, the final DXF is 3D when tested in Autodesk TrueView.
    – Miro
    Commented Sep 3, 2015 at 12:36

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.