Files
-
- 500 KB
- Download
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.
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, 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.
As of FME 2025.2, the Coordinate System parameter is now configured within the Parameters dialog of each reader/writer format. For more information, including details about the change and affected transformers, please see Coordinate System Parameter Location Change.
Ensure that the Group Elements By parameter is set to Level Name. When we group elements by level name on feature types, we see the level name rather than the level number. Click OK twice to add the reader.
2. Inspect Data
Now let’s see what our data looks like. Click the <All> reader feature type on the canvas to open the mini menu. Then, click the View Source Data button on the mini toolbar to view the data in the Visual Preview window.
Open the Graphics View in the Visual Preview window (or FME Data Inspector). There are various levels, each represented by its own color, but we don’t have a schema. We will need to create one.
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.
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 Single Merged Feature Types is selected in the reader; it contains the level or layer names.
4. Set the Output (Writer) Format to Esri Shapefile
Next, we need to add a writer to the canvas. Click on Add Writer, and in the Add Writer dialog, select Esri Shapefile for the Format. Then, browse to a folder for the Dataset to save the shapefile. Change the Shapefile Definition to Automatic; this setting will automatically add the new attribute RoadType to the reader. Click OK to add the writer.
After clicking OK, the Feature Type dialog will appear. Set the Shapefile Name to Roads, and change the Geometry to shapefile_line. By default, the parameter is set to shapefile_first_feature.
5. Connect Writer and Run the Workspace
Connect the Roads writer feature type to the AttributeManager.
Once connected, the workspace is ready to be run. To do so, click on the green play button.
The Translation Parameter Values dialog will open. Click the ellipsis button next to Feature Types to Read. Then click Select all to write all layers to the shapefile.
6. View the Output Dataset
To view the output dataset, click on the Roads writer feature type to open the mini toolbar, then click on the View Written Data button.
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.