Bug report #10291

ogr2ogr dxf export does not work in Processing - Changing "AutoCAD DXF" to "DXF" might be a solution

Added by Håvard Tveite about 10 years ago. Updated almost 9 years ago.

Assignee:Victor Olaya
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:Yes Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:18719


In the Processing toolbox, under GDAL/OGR-> OGR Conversion-> Convert format,
it does not seem to be possible to export as DXF.
It is possible to choose "AutoCAD DXF", but when the function
is run, an error is returned:

ERROR|Fri May 16 2014 15:33:26|Uncaught error while executing algorithm|Traceback (most recent call last):|Traceback (most recent call last):| File "C:/Users/havatv/.qgis2/python/plugins\\processing\\core\\GeoAlgorithm.py", line 203, in execute| self.processAlgorithm(progress)| File "C:/Users/havatv/.qgis2/python/plugins\\processing\\algs\\gdal\\ogr2ogr.py", line 147, in processAlgorithm| poDstDS = driver.CreateDataSource(dst_ds, options=ogr_dsco)|AttributeError: 'NoneType' object has no attribute 'CreateDataSource'|

I had a look at the code, and it seems as if the format has to be
"DXF" and not "AutoCAD DXF". After I had changed the ogr2ogr.py
file as follows:

$ diff ogr2ogr.py.org ogr2ogr.py
< 'AutoCAD DXF',


no errors occured, and a file was created.


#1 Updated by Håvard Tveite about 10 years ago

Here is a readable version of the diff output

$ diff ogr2ogr.py.org ogr2ogr.py
<     'AutoCAD DXF',
>     'DXF',

#2 Updated by Giovanni Manghi about 10 years ago

  • Affected QGIS version changed from 2.2.0 to master
  • OS version deleted (7)
  • Operating System deleted (Windows)

#3 Updated by Giovanni Manghi almost 10 years ago

  • Resolution set to fixed/implemented
  • Status changed from Open to Closed

#4 Updated by Giovanni Manghi almost 9 years ago

  • Category changed from 94 to Processing/Core

Also available in: Atom PDF