Toblerity / Fiona

Fiona reads and writes geographic data files
https://fiona.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.15k stars 201 forks source link

DXF exporter writes layer tag in wrong subclass #869

Closed mozman closed 4 years ago

mozman commented 4 years ago

Your DXF exporter for LWPOLYLINE (and maybe other entities) writes the layer tag (group code 8) in front of the subclass marker AcDbEntity, according to the DXF reference this tag should be written after the the AcDbEntity marker:

AcDbEntity

Excerpt from DXF file created by your package:

image

AutoCAD and BricsCAD do read this files, so it is not really a bug!

To the argument "don't assume tags in a particular order": This is true inside of a subclass but not overall subclasses, because with the introduction with DXF R13/14, the same group tag can occur in different subclasses with different meanings and a tag can also occur multiple times in the same subclass, example LWPOLYLINE vertex tag (10).

I am the author of ezdxf and got an error message from one of your users:

I have created a dxf by exporting a geopandas dataframe in python using fiona - a python wrapper for gdal/OGR. (Python version 3.7.4)

It would be nice if you could correct this issue in your package.

rbuffat commented 4 years ago

Fiona is a wrapper library for GDAL. GDAL is a library for input and output of geospatial data. Some supported formats, e.g. DXF, deviate from the GDAL data model and thus have some limitations: https://gdal.org/drivers/vector/dxf.html

As the implementation of the DXF input/output is within GDAL, I would suggest creating your bug report on their issue tracker: https://github.com/OSGeo/gdal

mozman commented 4 years ago

Ok and thank you for your response.