How to Convert DGN to Shapefile (CAD Levels to GIS Attributes)

Liz Sanderson
Liz Sanderson
  • Updated

FME Version

Introduction

This tutorial will show you how to convert Bentley MicroStation Design (*.dgn) to Esri Shapefile (*.shp). We will combine several CAD levels into a single output shapefile, and then translate the CAD level names to GIS attributes.

 

Video

This video was created with FME version 2016.0. Some of the steps might be slightly different, but the overall process is the same for newer versions of FME.

 

Step-By-Step Instructions

1. Add a Bentley MicroStation Design (V8) Reader

Open a blank FME Workspace and add a new reader. In the reader dialog, type in Bentley MicroStation Design (V8), then browse to the Roads.dgn file. Set the Coord. System to UTM83-10, and then set the Workflow Options to Single Merged Feature Type. Since we will have many levels (road types), we want to merge them all into one feature type to make it easier to work with. Click on the Parameters button.

 

In the parameters, ensure that the Group Elements By is set to Level Name. When we group elements by level name on feature types, we will see the level name rather than the level number. Click OK twice to add the reader.

readerparams.png

 

2. Inspect Data

Now let’s see what our data looks like. Click on the <All> reader feature type on the canvas to open the popup menu. Then on the popup menu click the View Source Data button to view the data in the Visual Preview Window.

viewsourcedata.png

 

In the Visual Preview window (or FME Data Inspector), open the Graphics View, it looks like we have various levels each represented by its own color, but we don’t have any schema. We will need to create a schema.

Note: This step can also be completed in FME Data Inspector for versions previous to FME 2019. Just add an Inspector transformer and then run the translation.

 

3. Add an AttributeManager Transformer

To create a schema, we will use the AttributeManager transformer. Add an AttributeManager to the canvas and connect it to the <All> reader feature type.

attributemanagerworkflow.png

 

In the parameters, rename fme_feature_type to RoadType and click OK. fme_feature_type is an FME specific format attribute that is enabled when Singe Merged Feature Types is selected in the reader; it contains the level or layer names.

attributemanager.png

 

4. Set the Output (Writer) Format to Esri Shapefile

Next, we need to add a writer to the canvas. Click on the Add Writer and in the Add Writer dialog box, for the Format, select Esri Shapefile. Then for Dataset, browse to a folder to save the shapefile. For the Shapefile Definition, change it to Automatic, this setting will automatically add the new attribute RoadType to the reader. Once you’ve done that, then click OK to add the writer.

writer.png

 

After clicking OK, the Feature Type dialog will appear. Set the Shapefile Name to Roads, and change the Geometry to shapefile_line.

writerparams.png

 

5. Connect Writer and Run the Workspace

Connect the Roads writer feature type to the AttributeManager.

finalworkflow.png

 

Once connected, the workspace is now ready to be run. Run the workspace by clicking on the green play button.

 

6. View the Output Dataset

To view the output dataset, click on the Roads writer feature type to open the popup menu, then click on the View Written Data button.

viewwrittendata.png

 

In Visual Preview, you should have a RoadType attribute containing the various levels.

 

 

Data Attribution

The data used here originates from open data made available by the City of Vancouver, British Columbia. It contains information licensed under the Open Government License - Vancouver.

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.