GIS to CAD: Convert Parcel Polygons and Lines from Geodatabase to DGN

Liz Sanderson
Liz Sanderson
  • Updated

FME Version

  • FME 2020.1

Introduction

A GIS to CAD transformation requires schema changes so that the same features can be represented in a CAD environment. As GIS data has a specific data structure of features and attributes whereas a CAD files stores features as complex geometries with symbology and attributes as text. To maintain the same GIS representation as a CAD file, attributes are transformed into annotations and symbology. In addition to extracting the data to create an accurate representation, defining the content and style of the CAD objects is necessary.

This article provides an overview of some of the typical tasks performed in a GIS to CAD transformation.

  • Create text features from Esri File Geodatabase attribute values, style and attribute the text features, then write them as DGN text levels to a MicroStation file
  • Style and attribute polygon and line features, then write them as DGN polygon and line levels to a MicroStation file

 

Step-by-Step Instructions

1. Read in Source Data

Start FME Workbench. On the Start Page, select New Workspace to create a blank canvas. 
Add a Reader to the workspace (from the Readers menu select Add Reader).
Set the Format to Esri File Geodatabase and set the Dataset to read the NorthVancouver.gdb. 
Select all 3 available Feature Types, District, Parcel and ParcelLine.

2. Create Text Features from Attribute Values

Each of the three feature types undergoes a number of similar transformations to produce text features from attribute values. Once text features have been created, each are styled and attributes are added by the same process.
 

2a. District Text:

1. Create Center Point for each Polygon

Add a CenterPointReplacer transformer to the canvas. Connect the District feature type to the CenterPointReplacer. Open the parameters. Set the Mode to Center Point Of Bounding Box. The CenterPointReplacer replaces each polygon with a point, so that it is possible to add a text label. 
 

2. Create Labels for each Polygon

Add a LabelpointReplacer transformer to the canvas. Connect the Point output port to the LabelPointReplacer. Open the transformer’s parameters, set the Label as BlockID and Label Height to 60. 
 

3. Style Text

Next, add a DGNStyler transformer to the canvas. Connect the LabelPointReplacer to the DGNStyler. The DGNStyler is used to set the color and size of the text in the output DGN drawing. In the parameters, enable the Color option and set the RGB color to your desired value. I used 85,0,127. Enable Text, set the font number to 25, and Text Justification to Center Center. 
 

4. Create Element Priority Attribute

Add an AttributeCreator transformation to the canvas. Connect the DGNStyler to the AttributeCreator. The AttributeCreator will be used to create an attribute that will bring the text to the forefront in the DGN Drawing. Open the transformer parameters and name the new attribute, igds_element_priority, and set the value to 1. 
 

5. Rename Attributes

Add an AttributeRenamer transformer to the canvas. Connect the AttributeCreator to the AttributeRenamer. Rename the District Attribute to igds_basename. This is necessary as the DGN needs to know which attribute to use as the basename. 
 

6. Add DGN Reader

Add a Microstation DGN V8 Writer to the canvas. Set the location of the output dataset. Open the writer parameters, click the ellipsis button next to Seed File (V8 only) and set it to seed2_m_v8.dgn. Set level definition as Manual and click on the Format Attributes tab, expose the following attribute. 

  • igds_color
  • igds_graphic_group
  • igds_level
  • igds_style
  • Igds_weight


District Text Output

 

2b. Parcel Text:

1. Filter LotID

Add a Tester transformer to the canvas, the Tester will be used to see if the LotID attribute is populated or not. In the parameters, set up the following Test Clause. Any of the LotIDs that do not have an Attribute will not pass. 


 

2. Create Center Point for each Polygon

Add another CenterPointReplacer transformer to the canvas. Connect the CenterPointReplacer_2 to the Passed output port of the Tester. Open the CenterPointReplacer_2 parameters, set the Mode to Center Point of Bounding Box. 
 

3. Create Labels for each Polygon

Add another LabelPointReplacer to the canvas, connect the CenterPointReplacer_2 Point output port to the LabelPointReplacer_2 transformer. Open the transformer parameters and set the Label to LotID and Label Height to 2.25.


 

4. Style Text

Add another DGNStyler transformer to the canvas, connect the LabelPoint output port from the LabelPointReplacer_2 to the DGNStyler_2. Open the DGNStyler_2 parameters, tick the boxes for Color and Text. Choose the desired color of the Text, I chose red (1,0,0). Set the Font Number to 25, just like we did with the District Text. Set the Text Justification to Center Bottom. 
 

5. Create Element Priority Attribute

Add another AttributeCreator transformation to the canvas and connect it to the DGNStyled output port of the DGNStyler_2. Open the transformer parameters and create a new attribute igds_element_priority set the Attribute Value to 1.
 

6. Create Element Priority Attribute

Connect an AttributeRenamer to the AttributeCreator_2 and rename the District attribute to igds_basename. 
 

7. Duplicate Writer Feature Type

Right-click on the DistrictLBL Writer and select Duplicate. Set the Level Name to ParcelLBL. This will save time having to expose the same attributes again. Connect the AttributeRenamer_2 to the ParcelLBL. 


Parcel Text Output


2c. Parcel Line Text:

1. Filter Text by Length

This process is very similar to the steps we undertook for the Parcel Text. Set up another Tester transformer, connect it to the ParcelLine Reader, set up a Test Clause to see if the Length Attribute has a value or not.

Test Clause:

Logic

Left Value

Operator

Right Value

NOT

Length

Attribute Is Null

<Unused>

You can choose to duplicate the Tester from the Parcel text Bookmark and change the Left Value to Length. 
 

2. Create Center Point for each Polygon

Use a third LabelPointReplacer to replace each point with a text feature, based on the Length attribute value, set Label height to 1.5. 
 

3. Style Text

Connect another DGNStyler to the LabelPoint output port. Set the Color and Text size of the parcel line text to (1,0.666667,0) Font number 25, Center Center justification. 
 

4. Rename District

Add another AttributeRenamer to rename the District attribute to igds_basename.
 

5. Create Element Priority Attribute

Add another AttributeCreator transformation to the canvas and connect it to the DGNStyled output port of the DGNStyler. Add a New Attribute called igds_element_priority and set the Attribute Value to 3. 
 

6. Create Element Priority Attribute

Rename the District attribute using an AttributeRenamer. Set the Output Attribute to igds_basename.
 

7. Duplicate Writer Feature Type

Right-click on the ParcelLBL Writer Feature Type and select Duplicate. Set the Level Name to ParcelLineLBL click ok to add to the canvas. This will save time having to expose the same attributes again. Connect the AttributeRenamer_3 to the ParcelLineLBL. Expose these additional attributes. 

  • igds_rotation
  • Igds_font

Parcel Line Text Output

Creation of Text Features from Attribute Values Bookmark.

 

3. Style and Attribute Polygons and Lines

In this section of the workspace we will take steps just like the steps that we took with the text, each of the District Polygons, Parcel Polygons and Parcel lines will go through a similar process. Using a DGNStyler, AttributeCreator and AttributeRenamer. 
 

3a. District Polygons:

1. Style Text

Add a DGNStyler transformer to the canvas and connect the District reader feature class to the DGNStyler_4. Open the DGNStyler_4 parameters, expand the Color section, set the RGB Color to (0,85,0) and RGB Fill Color to (0,120,0) click ok to close the parameters dialog box.


 

2. Style Text

Add an AttributeCreator transformer to the canvas. Connect the AttributeCreator_4 to the DGNStyled output port. Similar to the other AttributeCreators, create a new attribute called igds_element_priority and set the value to 6.


 

3. Rename Attributes

Add an AttributeRenamer to the canvas, connect the AttributeRenamer_4 to the Output port of the AttributeCreator_4. Select District as the Input Attribute and set the Output Attribute as igds_basename. 


 

4. Add Writer Feature Type

Right-click on the canvas and select Insert Writer Feature Type. Set the Level name as District. District. Set the Level Definition to Manual. Click on the Format Attributes tab and select the following attributes to expose. 

  • igds_color
  • igds_graphic_group
  • igds_level
  • igds_style
  • igds_weight

Click ok to add the Feature Type to the canvas, connect the District Feature Type to the AttributeRenamer_4 Output port. 

District Polygons Output

 

3b - Parcel Polygons:

You can duplicate the process quickly by right-clicking on the District Bookmark and clicking Select All Objects in Bookmark and using the keyboard shortcut CTRL+C to copy everything then paste the Bookmark to the canvas. To create a Bookmark you can create a selection box around the transformers, readers, and writers and use the keyboard shortcut of CTRL+B or right-click and choose Insert Bookmark. Now there only needs to be some minor adjustments made to the transformers. 

Connect the Parcel reader feature type to the DGNStyler_5. Open the DGNStyler_5 parameters and adjust the RGB Color and RGB Fill Color. 

Open the AttributeCreator_5 and change the Attribute Value of igds_element_priority to 5. Setting to 5 so that the polygons appear in the background in MicroStation, with text in the foreground. There will be no need to change anything in the AttributeRenamer_5. Finally change the Level Name in the DGN writer feature type to Parcel. 
Parcel Polygons Output

3c - Parcel Lines:

Right-click on the District Polygons Bookmark and click Select All Objects in Bookmark, copy then paste the Bookmark to the canvas. Change the RGB Color in the DGNStyler_6 and remove any RGB Fill Color. Change the Attribute Value in the AttributeCreator_6 to 4. Finally, change the Level Name to ParcelLine in the DGN writer feature type and run the entire workspace.

Parcel Lines Output

Style and Attribute Polygons and Lines Bookmark

 


Results

A MicroStation DGN file with 6 levels: 3 text levels, 2 polygon levels, and 1 line level.
Output in FME

 

Data Attribution

The data used here originates from open data made available by the District of North Vancouver. It contains information licensed under the Open Government License - North Vancouver.

 

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.