Exercise 3b: Transforming data and using Data Inspector
A transformer is an FME Workbench object that performs a particular restructuring of features or schema. It is a visual object that you add to your workspace canvas and connect between the source and destination features, or to other transformers.
This exercise introduces you to the fundamentals of using FME transformers. You create a spatial ETL tool that transforms MGE parcel data and generates new output. Finally, you inspect the output of your workspace without generating data using Data Inspector.
Using FME Workbench, perform the following tasks:
- Add an AreaBuilder transformer to create polygons from the LOT_LINES source feature type.
- Add a PointOnAreaOverlayer transformer to overlay the LOT_POINTS features onto the polygon features and merge their attributes.
- Redirect the output of the workspace to Visualizer and inspect the output of your workspace.
After running the tool and generating the data, add the dataset to ArcMap to verify your results.
Start ArcMap
The Data Interoperability extension must be enabled.
Before starting this exercise, you must have completed the previous exercise, Exercise 3a: Getting started with spatial ETL.
- Start ArcMap.
- Click Catalog on the Standard toolbar.
-
Type C:\arcgis\ArcTutor\Data Interoperability\parcels\ in the Location text box and press ENTER.
The location is added to the Catalog tree under Folder Connections.
Copy and rename the spatial ETL tool
In this exercise we will be learning the fundamentals of transforming features and attributes in FME Workbench and using Data Inspector to verify output.
- Right-click the Import MGE Parcel tool and click Copy on the context menu.
- Right-click the Parcels toolbox and click Paste on the context menu.
- Right-click the Import MGE Parcel (2) tool, click Rename on the context menu, and type Custom Parcels.
- Right-click the Custom Parcels tool and click Edit.
Workbench starts.
Add an AreaBuilder transformer
The AreaBuilder transformer creates topologically correct polygon features from lines that form closed shapes. Connect an AreaBuilder transformer to the LOT_LINES GeometryFilter.
- Confirm that Transformer Gallery is available.To open the Transformer Gallery window from the main menu, click View → Windows → Transformer Gallery.
- In the Transformers Gallery window, type areabuilder in the Search text box and press ENTER.
-
Double-click AreaBuilder.
An AreaBuilder transformer is added to the canvas.
-
Click the line connecting the LOT_LINES GeometryFilter and the LOT_LINES destination feature and press DELETE.
The GeometryFilter is disconnected from the destination feature type.
- On the LOT_LINES GeometryFilter, click the yellow arrow beside the LINE attribute output.
- Click the red arrow beside the AreaBuilder input.
The GeometryFilter output is connected to the AreaBuilder input and the arrow turns green.
Add a PointOnAreaOverlayer transformer
The PointOnAreaOverlayer transformer overlays point features onto area features and merges their attributes. As a result, each polygon feature acquires attributes from the point feature contained within its boundary. Attributes with the same name are not replaced.
Connect a PointOnAreaOverlayer transformer to the LOT_LINES AreaBuilder transformer and the LOT_POINTS GeometryFilter.
- In the Transformer Gallery window, type PointOnArea in the Search text box.
-
Double-click PointOnAreaOverlayer.
A PointOnAreaOverlayer transformer is added to the canvas.
- Click the line connecting the LOT_POINTS GeometryFilter and the LOT_POINTS destination feature type and press DELETE.
The GeometryFilter is disconnected from the destination feature type.
- On the LOT_POINTS GeometryFilter, click the yellow arrow beside the POINT output.
- Click the red arrow beside the PointOnAreaOverlayer POINT input.
The GeometryFilter POINT output is connected to the PointOnAreaOverlayer POINT input and the arrow turns green.
- On the AreaBuilder Transformer, click the red arrow beside the AREA output.
-
Click the red arrow beside the PointOnAreaOverlayer AREA input.
The AreaBuilder AREA output is connected to the PointOnAreaOverlayer AREA input and the arrow turns green.
Organizing the canvas layout
At this time, the connectors may begin to cross over each other and appear confusing. There are several ways to organize the canvas layout:
- Click Tools → Auto Layout.
- Manually click and drag the objects on the canvas.
- Right-click a connector line, click Insert Vertex on Connection on the context menu to add one more vertex, and drag each vertex to route the connector around other transformers.
Redefine the LOT_POINTS destination feature
Redefine the LOT_POINTS destination feature to generate the polygon features.
- Connect the AREA output on the PointOnAreaOverlayer transformer to the INPUT on the LOT_POINTS destination feature.
- Click the Properties button on the LOT_POINTS destination feature.
The Feature Type Properties dialog box opens.
- Click the General tab.
- In the Feature Type Name text box, type parcels.
- Click the Allowed Geometries arrow and choose geodb_polyline.
- Click the User Attributes tab.
- Select only the attributes with names that start with igds_ and click Removes the current row control (–).
- Click OK.
- The Feature Type Properties dialog box closes.
Verify the output of your workspace with Data Inspector
Data Inspector is an in-memory viewer that enables you to inspect the output of your workspace without generating data or overwriting existing data.
Redirect the output of your workspace to Data Inspector and verify your results.
-
In the Navigator window, expand Tool Parameters, right-click Destination Redirect, and click Edit Parameter Value from the context menu.
The Edit Parameter dialog box opens.
- Click the Destination Redirect arrow and choose Redirect to Inspection Application.
- Click OK.
The Edit Parameter dialog box closes.
-
On the main menu, click File → Run Translation.
Data Inspector starts.
- Expand the datasets in Viewspace.
- Click the Select tool on the toolbar, select features, and explore their attribute values displayed in the Feature Information window.
- Exit Data Inspector.
- (Optional) If you want to write the data the next time you run this workspace, repeat Step 1 in the Workbench Navigator window, and in the Edit Parameter dialog box, select No Redirect.
- On the Workbench menu, click File → Save.
This completes the exercise.
Advanced tasks
Optionally complete the following exercises on your own:
- Insert a Tester transformer into the workspace to test the Overlap Count attribute generated by the PointOnOverlayer transformer. Polygon features that contain one point feature pass the test and are directed to the LOT_POINTS destination feature. Polygon features that do not contain one point feature fail the test and are directed to the LOT_LINES destination feature.
- Save the spatial ETL tool as a custom format. A custom format is a translation workspace exported as a format and utilized in the FME reader gallery. It is saved to an external (.fds) file and can be imported to reader galleries on other desktops.