Besides reading from a geodatabase, FME can also write data to a geodatabase, by either
writing to an existing geodatabase or creating a new geodatabase and writing data to it.
There are also parameters in FME that allow you to use either an existing geodatabase
or an Esri XML workspace document as a template to create a geodatabase with a predefined
structure at the same time as it writes data to some of the tables. This also means that,
for complex workspaces, you will be able to copy: domain and subtype definitions, relationships
and 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.
Our source data consists of an Esri shapefile, a KML file and an AutoCAD drawing file.
The shape file consists of a polygon representing the land boundary of a city.
The KML data set represents city neighborhoods, which is also a set of polygon geometries.
The AutoCAD data set uses line features to represent the boundaries of land parcels.
In this translation we will start with a new canvas and add readers and writers separately.
Let's start by adding an Esri shape reader.
Select the Vancouver land boundary file as the data.
Next, let's add a Google KML reader.
Select the Vancouverneighborhoods.KML file.
When adding the KML reader, we will be prompted with a feature types dialog window;
for this example we will only select neighborhoods from the list.
Finally, we will add a DWG DXF reader.
Select the parcel lines AutoCAD source file.
To expose the extended entity data of the DWG file, it is important to set the group
entities by selection to attribute schema in the DWG DXF reader parameters.
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
we can use an area builder transformer to accomplish this.
The area builder takes a set of line features and creates polygons where the lines form
topologically closed shapes.
Another required task, is to create an ID number for each parcel polygon.
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.
To match what I know the output schema to be the attribute will be named parcel ID.
To write a geodatabase we now need to add a writer.
In the parameters dialog we will choose to overwrite an existing version of this database,
instead of adding data to it.
Also, rather than creating the geodatabase from scratch, we will set a parameter to tell
FME to use an ArcGIS XML workspace document as a template.
Such a document can be created in arc GIS, as an export from an existing geodatabase.
We now need to tell FME which tables from the template we intend to write data to at this point.
We do this by setting the ad feature types parameter to import from data set.
When you click OK FME will search the template for a list of tables.
When prompted, we will select the three tables that we are writing to;
neighborhoods, parcels and vancouver land boundary.
Click OK.
Once added, connect the output of the respective readers to the corresponding geodatabase writers.
We should also check for attributes that don't match so, go ahead and expand the neighborhoods
reader and writer feature types.
We can see that there are attributes that we need to fix; let's do this by, once again,
connecting the corresponding ports.
Our final task will be to set the output coordinate system
to be UTM83-10.
Go ahead and run the workspace
and then set the destination folder.
Let's view the output with Arc Map.
Although only three feature classes are defined, more feature classes than that will be created.
The three feature classes in the workspace are the ones that we want to add data to as
they are being created.