I'm trying to open a DGN file with Python.
I've tried with OGR:
driver = ogr.GetDriverByName("DGN")
file = driver.Open("C:\path_to_dgn\example.dgn")
which returns a NoneType
object.
I've tried with Fiona:
fiona.open("C:\path_to_dgn\example.dgn")
which returns this error:
fiona.errors.DriverError: 'C:\path_to_dgn\example.dgn' not recognized
as a supported file format.
The DGN is a Microstation v8 file, I'm not sure if that changes anything.
Best Answer
GDAL/OGR and any software that is based on it (Fiona, GeoPandas etc.) can only read DGN < v.8 by default. From the DGN Driver doc:
The DGNv8 driver is not built-in by default and is only available when GDAL has been compiled against the proprietary (non open source) Open Design Alliance Teigha library