Converting to Geodatabase Format

Liz Sanderson
Liz Sanderson
  • Updated

FME Version

  • FME 2020.2

Introduction

Besides converting data from an Esri geodatabase, FME can also convert data to a geodatabase by either writing to an existing geodatabase or creating a new geodatabase and writing data to it.

Additionally, FME has the capability to create a new geodatabase using either an existing geodatabase or an Esri XML workspace document as a template.

This means that, for more complex workspaces, you will be able to copy domain & subtype definitions, relationships & network information, and annotation symbols from one geodatabase to another.

In this tutorial, we will explore one approach for reading any format of data and writing it to a geodatabase using an XML workspace document as a template.
 

Video

This video was recorded using FME 2016.0, the interface may be different but the concepts are the same.

 

Source Data

The source data for this exercise consists of an Esri shapefile representing the land boundary of the city of Vancouver as a single polygon:

Vancouver Land Boundary polygon Shapefile visualized in Data Inspector. Map tiles by Stamen Design, under CC-BY-3.0. Data by OpenStreetMap, under CC-BY-SA.

Vancouver land boundary polygon visualized in Data Inspector. Map tiles by Stamen Design, under CC-BY-3.0. Data by OpenStreetMap, under CC-BY-SA.


...a KML file that represents city neighborhoods as a set of polygon geometries:

Vancouver neighbourhood polygon from KML file visualized in Data Inspector. Map tiles by Stamen Design, under CC-BY-3.0. Data by OpenStreetMap, under CC-BY-SA.
Vancouver neighbourhood polygon visualized in Data Inspector. Map tiles by Stamen Design, under CC-BY-3.0. Data by OpenStreetMap, under CC-BY-SA.


...and an AutoCAD Drawing file that represents the boundaries of land parcels as individual line features:

Parcel boundary line data visualized in Data Inspector. Map tiles by Stamen Design, under CC-BY-3.0. Data by OpenStreetMap, under CC-BY-SA.

Parcel boundary line data visualized in Data Inspector. Map tiles by Stamen Design, under CC-BY-3.0. Data by OpenStreetMap, under CC-BY-SA.

 

Step-By-Step Instructions

1. Add Esri Shapefile Reader
In this translation, we will start with an empty canvas and add readers and writers separately. So start FME Workbench and click the Main tab.

Select Readers > Add Reader from the menu bar. In the Add Reader dialog that opens, set Esri Shapefile as the source format and select the file VancouverLandBoundary.shp as the source dataset.
 

2. Add Google KML Reader
Select Readers > Add Reader from the menu bar again. This time set the format as Google KML and select the file VancouverNeighborhoods.kml as the source dataset.

When prompted as to which feature types (layers) to add to the translation, select only Neighborhoods and leave all others unselected.
 

3. Add Autodesk AutoCAD DWG/DXF Reader
Now select Readers > Add Reader for one last time. This time the format is Autodesk AutoCAD DWG/DXF and the source dataset is Parcels.dwg.

Before clicking OK to add the reader, first click the parameters button and set the parameter "Group Attributes By" to "Attribute Schema".

The workspace will now look like this:

kcgeodatabasewriting1.png
Workspace after adding the three reader feature types.


4. Add AreaBuilder Transformer
The source AutoCAD DWG file consists of line features that represent the boundaries of property parcels. We wish to write them as polygons in the geodatabase and, in order to do so, we need to transform the data during translation. An AreaBuilder transformer can be used to accomplish this.

So place an AreaBuilder transformer and connect it to the ParcelLines feature type.


5. Add Counter Transformer
Each parcel polygon should be given an ID number. The Counter transformer is one way to do this.
Starting from zero, each feature passing through the transformer receives an incremented numeric value as an attribute.

So place a Counter transformer and connect it to the AreaBuilder's Area output port.

Open the parameters dialog and set the Count Output Attribute to ParcelId, to match the output schema.

Workspace after adding AreaBuilder and Counter transformers. Set Counter parameters to be the same as the image.


Workspace after adding AreaBuilder and Counter transformers. Set Counter parameters to be the same as the image.

6. Add Esri Geodatabase Writer
To write a Geodatabase we now need to add a Writer.

Select Writers > Add Writer from the menu bar. When prompted set the format to Esri Geodatabase (File Geodb). Click the Parameters button.

In the parameters dialog set Overwrite Existing Database to Yes. Under Template File select the provided ArcGIS XML Workspace Document named VANCOUVERCITYTEMPLATE_V10.XML. This is an XML-based template that can be created by exporting an existing geodatabase in ArcGIS. Click OK to close the parameters dialog.
Use the provided XML workspace document named VANCOUVERCITYTEMPLATE_V10.XML for the geodatabase schema.
Use the provided XML workspace document named VANCOUVERCITYTEMPLATE_V10.XML for the geodatabase schema.

 

FME will create a new geodatabase with all of the content of this template. However, to tell FME we wish to write data into some of those tables now, change the “Add Feature Types” parameter to “Import from Dataset”:

Select Esri Geodatabase (File Geodb) as the writer format and ensure Feature Class or Table Definition is ‘Import from Dataset…’.
Select Esri Geodatabase (File Geodb) as the writer format and ensure Feature Class or Table Definition is ‘Import from Dataset…’.
 

Click OK to close the Add Writer dialog.


7. Add Esri Geodatabase Writer Feature Types
When prompted (with an Import Feature Types Dialog) set the format to Esri Geodatabase (XML Workspace Document) and for the dataset again select the Vancouver XML template file.

Click OK to have FME search the template for a list of tables. When prompted, deselect all tables and then re-select the 3 tables to write to: VancouverLandBoundary, Parcels, and Neighborhoods. Click OK.


8. Connect Readers to Writer Feature Types
Once added, connect the output of the respective reader(s) to the corresponding Geodatabase writer(s):

Workspace after adding the geodatabase writer feature types.

Workspace after adding the geodatabase writer feature types.



9. Map Neighbourhood Attributes From Reader to Writer 
Expand the Neighborhoods reader and writer features types. There are attributes that need to be mapped from the reader to the writer.

Draw connections for ID, Name, URL, Pop2001, Pop2011

The Neighbourhoods writer feature type have five attributes mapped from the corresponding reader feature type.
The Neighbourhoods writer feature type has five attributes mapped from the corresponding reader feature type.



10. Set Writer Coordinate System
Finally, locate the coordinate system setting for the geodatabase writer in the Navigator window. Set the output coordinate system to UTM83-10:

Set the coordinate system to UTM83-10 for the output geodatabase in the Navigator window.
Set the coordinate system to UTM83-10 for the output geodatabase in the Navigator window.


11. Run Workspace
Run the workspace. You will be prompted to select a location to write the new geodatabase to, and there may be a warning about Unexpected Input - but that can be ignored.

Inspect the output (with either ArcMap or the FME Data Inspector). The feature classes defined are all those that existed in the template, but only the three that we imported into the FME workspace contain data.

 

Notes

The File Geodb reader used in the example requires a version of ArcGIS installed and licensed. If ArcGIS is not available, the Open API reader can be used instead. However, please note that this reader/writer does not offer the same level of functionality in all scenarios. For more information please see the following: Comparison of FME readers and writers for SDE and Geodatabase and Required ArcGIS license types for FME Geodatabase formats

 

Data Attribution

The data used here originates from 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.