[GIS] Exporting QGIS contour attributes in DXF file

autodeskcontourdxffields-attributesqgis

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.

Best Answer

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.