I am using ogr2ogr (GDAL) to convert DXF files (from autoCAD) to geoJSONS for usage inside Leaflet.js
The issue is that a lot of information, like line stroke size and colors are not kept during the conversion.
I would like to extract them, so that I can use them later with the geoJSON, even if I have to implement that manually. How can I do this ?
My only option for the moment is parsing myself the DXF and look for colors but there must be a better way
Best Answer
Have a look at the attributes. GDAL can read the styles from DXF:
However, styles are not written into GeoJSON automatically but you can do it with the -sql parameter:
Check the result:
It is somehow odd that now Style goes both into OGR_STYLE and into Style, but at least you can get those. OGR_STYLE is documented in http://www.gdal.org/ogr_feature_style.html.