Previous: , Up: Other Formats   [Contents][Index]


7.6.4 GeoJSON

dwgread supports writing to the GeoJSON format as specified at http://geojson.org/geojson-spec.html. See dwgread with the --fmt GeoJSON option.

We write in the RFC7946 format, the new GeoJSON format since 2016, which means smaller, less precision, and normalized polygons with proper right-hande rule orientation.

We write all coordinates as [x, y], not [y, x]. z-coordinates are optional, and only written if not 0.0. Colors are either written as palette index as integer if not 256 (ByLayer), or as TrueColor RGB hex string values for all r2004+ DWG’s.

Missing entities: No 3D entities, HATCH by definition. ELLIPSE, polyline bulges would need segmention into line segments. MLINE, SPLINE, MINSERT, SOLID, TRACE, RAY(?), XLINE(?)

Due to implementation quirks with ending commas in JSON, we mostly add an empty dummy feature at the very end, with null properties and null geometry.