Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm trying to export a DXF file from Qgis1.8.0 Lisboa and can not have a 3Dfile in Autocad! Or micristation. It results always in 2D file. How can I export height data from a shape file in Qgis?

Regards

Jorge Marques

share|improve this question

3 Answers 3

If you want to get a 3D DXF from a SHP (SHPfile generated from DTM with Qgis-Processing-Tools-GDAL/OGR Extraction-Contour), you must:

1) have column with Z values into Table attributes of SHP. 2) open "OSGeo4W Shell Commands" if you have Windows OS. 3) write into shell for example:

ogr2ogr -f "dxf" d:\Temp\3Doutput.dxf d:\Temp\contour.shp -zfield ELEV

the syntax is as follows: ogr2ogr -f "DXF" {outFile} {inFile} -zfield {ColumnWithZValue}

If an error appear, ignore it, go to the folder that contain the output file and if you find a file named "3Doutput" without extension (in this example), rename it as "3Doutput.dxf", then you will can open it with AutoCAD or other software.

share|improve this answer

You can't do it from within QGIS itself but you can do it this way:

http://nathanw.net/2011/05/05/3d-dxf-using-ogr/

ogr2ogr -f "DXF" {outFile} {inFile} -zfield {ColumnWithZValue}
share|improve this answer
    
Didn't work, it says it's not a recognized command. Any other tip? Thank you for your prompt response –  Jorge Marques Apr 1 '13 at 23:27
    
You will need to run it using the OSGeo4W shell (if your on windows that is) –  Nathan W Apr 1 '13 at 23:32
    
C:\>ogr2ogr -f "DXF" E:\tsteQgis\processameto\mapset\CN3D_vf E:\tsteQgis\process ameto\mapset\CN.shp -zfield CONTOUR ERROR 1: DXF layer does not support arbitrary field creation, field 'ID' not cre ated. ERROR 1: DXF layer does not support arbitrary field creation, field 'ELEV' not c reated. C:\>ogr2ogr -f "DXF" E:\tsteQgis\processameto\mapset\CN3D_vf1 E:\tsteQgis\proces sameto\mapset\CN.shp -zfield ELEV ERROR 1: DXF layer does not support arbitrary field creation, field 'ID' not cre ated. ERROR 1: DXF layer does not support arbitrary field creation, field 'ELEV' not c reated. –  Jorge Marques Apr 2 '13 at 9:41
    
That is the error that i got using the tip you gave me! I'm running out of solutions to overcome this problem. You know any other solution? Thank you so much! –  Jorge Marques Apr 2 '13 at 9:43
    
Does it still make the dxf file though. DXFs don't have fields so that is a warning your get not really a error. –  Nathan W Apr 2 '13 at 9:49

We export our files as a xyz text file for export into 12D for one of our contractors, which may also work if you are having problems, I haven't tried it since we don't have autocad or 12D

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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