From ARCGEN (Esri ArcInfo Generate) I want to create a DXF with distinguishable layers: import_polz.pol
The transformation to a three-dimensional shapefile runs flawlessly with gdal ogr2ogr:
ogr2ogr -f "ESRI Shapefile" export_lin.shp -nlt LINESTRING -dim 3 import_polz.pol; ogrinfo -so -al export_lin.shp
or
ogr2ogr -f "ESRI Shapefile" export_pol.shp -nlt POLYGON -dim 3 import_polz.pol; ogrinfo -so -al export_pol.shp
In the DBF, the ID assignments (ID,N,9,0) are correctly transferred with 1 and 2006, 2016, etc.
However, the conversion to a DXF file fails because of the assignment of the attributes to the layers:
ogr2ogr -f "DXF" export_lin.dxf -nlt LINESTRING -dim 3 import_polz.pol; ogrinfo -so -al export_lin.dxf
The response looks like this:
ERROR 1: DXF layer does not support arbitrary field creation, field 'ID' not created. INFO: Open of
export_lin.dxf' using driver
DXF' successful. Layer name: entities Geometry: Unknown (any) Feature Count: 390 Extent: (0.000000, 0.000000) - (150.000000, 20.000000) Layer SRS WKT: (unknown) Layer: String (0.0) PaperSpace: Integer(Boolean) (0.0) SubClasses: String (0.0) Linetype: String (0.0) EntityHandle: String (0.0) Text: String (0.0)
In the forum I could only find the ten year old hint that the DXF format is complicated: Errors when converting MapInfo .tab to .dxf
However, a newer version of ogr2ogr now seems to know how to assign layers: https://gdal.org/drivers/vector/dxf.html#dxf-writer
However, I have no success with the instructions. Does anyone know how to assign the polygon ID to a DXF layer?
A solution with gdal or QGIS3 is desirable.