gdal
gdal copied to clipboard
DXF: add a creation option to set the maximum number of decimal places
Feature description
The DXF drivers of GDAL/OGR 3.9.2 - 3.10 writes double precision floating point numbers with 15 significant figures:
https://github.com/OSGeo/gdal/blob/9ada0c882751f18c8156aa2fd51afd6f6540a46f/ogr/ogrsf_frmts/dxf/ogrdxfwriterds.cpp#L328-L333
https://github.com/OSGeo/gdal/blob/9ada0c882751f18c8156aa2fd51afd6f6540a46f/ogr/ogrsf_frmts/dxf/ogrdxfwriterlayer.cpp#L161-L166
AFAIK, AutoCAD normally writes coordinates in DXF with 16 significant figures and allows to set the maximum number of decimal places between 0 and 16. Refs:
- https://forums.autodesk.com/t5/autocad-forum/rounding-coordinates-of-line/m-p/8827743/highlight/true#M981665
- https://forums.autodesk.com/t5/autocad-forum/dxf-get-exported-precision-decimal-places-of-coordinates-and/m-p/9774788/highlight/true#M1031962
- https://help.autodesk.com/view/ACD/2024/ENU/?guid=GUID-D4242737-58BB-47A5-9B0E-1E3DE7E7D647#:~:text=You%20can%20control%20floating-point%20precision%20of%20the%20DXF%20format%20up%20to%2016%20decimal%20places
Additional context
No response