span8
span4
span8
span4
Besides converting data from a 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..
The source data for this exercise consists of an Esri shapefile representing the land boundary of the city of Vancouver as a single polygon:
...a KML file that represents city neighborhoods as a set of polygon geometries:
...and an AutoCAD Drawing file that represents the boundaries of land parcels as individual line features:
1.In this translation we will start with an empty canvas and add readers and writersseparately.Sostart FME Workbench and click the Main tab.
Select Readers > Add Reader from the menubar.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.Select Readers > Add Reader from the menubar 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.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:
4.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.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:Area output port.
Open the parameters dialog and set the Count Output Attribute to ParcelId,to match the output schema.
6.To write a Geodatabase we now need to add a Writer.
Select Writers > Add Writer from the menubar.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 ArcGIS XML Workspace Document provided.This is an XML-based template that can be created by exporting an existing geodatabase in ArcGIS.Click OK to close the parameters dialog.
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":
Click OK to close the Add Writer dialog.
7.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.Once added,connect the output of the respective reader(s) to the corresponding Geodatabase writer(s):
9.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
10.Finally,locate the coordinate system setting for the geodatabase writer in the Navigator window.Set the output coordinate system to UTM83-10:
11.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.
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
Required ArcGIS License Types for FME Geodatabase Formats.
Introduction to Working with Geodatabase Relationship Classes
Working with Geodatabase Subtypes: Creating A Subtype
Converting from Geodatabase Format
Writing Geodatabase Relationship Classes
Viewing and Inspecting Geodatabases
Tutorial: Getting Started with Geodatabase
Working with Geodatabase Field Aliases: Altering Alias Values
Using the FeatureReader to Query a Geodatabase
Geodatabase Behaviour: Updating a File Geodatabase
Working with Geodatabase Metadata: Writing/Updating Metadata
© 2019 亚搏在线Safe Software Inc |Legal