Learning Objectives

After completing this unit, you’ll be able to:

Resources

Note

Don't forget to follow along with the steps described below using your own copy of FME. You'll need to complete the steps to answer quiz questions.

Video

Write Out Your Data

Now that Sven has read in his source Excel business license data, he has to add an Esri geodatabase writer to create his new dataset.

He opens the workspace he was working on in FME Workbench (2021.0 or later) -- it has readers for the "business owners" and "public art" datasets. He needs to add an Esri geodatabase writer. He clicks on the canvas and starts typing “geodatabase”. A large number of writer formats match “geodatabase”.

Searching for "geodatabase" using Quick Add

Note

FME supports many versions of Esri Geodatabases, however, many of them are only accessible to users who have ArcGIS licenses. The version we are using, Esri Geodatabase (File Geodb Open API) can be used by anyone.

Sven selects the Esri Geodatabase (File Geodb Open API) writer and starts filling out the Add Writer dialog. Under Dataset Sven enters the location he wants his data to be saved. He enters “C:\FMEData2021\Output\Training\Vancouver.gdb”. All of the source datasets Sven will be working with are within the City of Vancouver and all of the writer feature types Sven creates with this workspace will be stored in the Vancouver.gdb file geodatabase.

Filled out Add Writer dialog

Note

For readers, the Dataset parameter points to one or more datasets to read. For writers, it points to the file or folder where new data will be created or an existing dataset will be updated. If you want to change this after adding a reader or writer, you can do so in the Navigator.

Note

You can use whatever path you want to write out your data, just remember your paths might be different from Sven’s if you don’t copy them exactly.

 Next, Sven clicks Parameters.

Parameters button

Clicking the Parameters button brings up the Esri Geodatabase (File Geodb Open API) Parameters dialog. Because Sven will be running this workspace often, and might be changing the schema of the output data due to changing requirements, Sven checks the Overwrite Existing Database option so that the geodatabase will be overwritten each time the workspace is run. Sven clicks OK to accept the changes made in the dialog.

Checking Overwrite Existing Database

The Coord. System is set as “Read from source”. This means the written data will take the coordinate system of the input data, which is LL84. This information will be stored in the geodatabase.

Sven hits OK and is then prompted to select a reader feature type to copy the writer feature type definitions from. A writer feature type will be created for each reader feature type selected here. He clicks Select All to select all the PublicArt and BusinessOwners feature types and clicks OK.

Importing all Feature Types

The writer feature types are then added to the canvas.

Feature types on the canvas

Control the Flow of Data

Now Sven needs to connect the reader feature types to the writer feature types. Sven connects the BusinessOwners reader feature type to the corresponding writer feature type by clicking the reader feature type output port (gray triangle), and dragging his cursor to the writer feature type input port (red triangle). A new connection line appears.

Connecting feature types

Sven ignores the PublicArt feature types for now. He wants to make sure the BusinessOwners feature type is working first. The workspace will still run with the PublicArt feature types disconnected. Sven then runs the workspace by clicking on the Run button on the toolbar.

Identify Problems Using the Translation Log

After the workspace finishes running, Sven notices that there are red entries in the log file shown in the Translation Log, meaning that errors have been reported. Sven clicks on Errors in the Translation Log to display errors only. Here Sven sees: 

FileGDB Writer: Feature class 'BusinessOwners' has shape type '<NO_GEOMETRY>' which is unknown to FME. Skipping feature class

Error in Translation Log

This error occurred because the newly added BusinessOwners feature type requires a geometry type of geodb_point, but this has not been set yet. You can see it isn’t set properly because the log reports its geometry type as “NO_GEOMETRY”.

Note

Fatal errors cause the workspace to stop running immediately. The “A fatal error has occurred” errors are caused by the first error in this case. Fixing the geometry will resolve all four errors. Errors that cause the workspace to stop running will often create additional error messages as the translation fails. Resolving the cause of the first error message will often resolve the subsequent error messages as well.

Fix the Error By Setting Writer Feature Type Parameters

To fix this error, Sven double-clicks on the BusinessOwners writer feature type to bring up the Feature Type dialog. He sets Geometry to “geodb_point” (the addresses are represented as points), and then clicks OK.

Setting writer feature type geometry type

Note

Not all formats are limited to a single geometry type per feature type. Most formats will support different types of geometry on the same layer or feature type. But the Esri geodatabase formats only allow a single geometry type per feature class, so this parameter must be set.

 He runs the workspace again by clicking on the "Run to this" icon on the writer feature type.

Run To This button

This time there are no errors reported in the Translation Log.

Exercise

Make sure you have followed along with Sven’s steps.