Skip to content

Latest commit

 

History

History
185 lines (125 loc) · 5.96 KB

File metadata and controls

185 lines (125 loc) · 5.96 KB
Exercise 2a Schema Editing
Scenario FME Workspace Author
Data City Parks (MapInfo TAB)
Overall Goal Calculate the size and average size of each park in the city, to use in Grounds Maintenance estimates for grass cutting, hedge trimming, etc.
Demonstrates Structural Transformation, Schema Editing
Start Workspace None
End Workspace C:\FMEData2015\Workspaces\DesktopBasic\Exercise2a-Complete.fmw

In this example, imagine that you are a GIS technician working for a city planning department.

The team responsible for maintaining parks and other grassed areas needs to know the area and facilities of each park in order to plan their budget for the upcoming year. You are to use FME to provide a dataset of this information.

The first step in this example is to rename existing attributes and create new ones in preparation for the later area calculations.

1) Start Workbench
Use the Generate Workspace dialog to create a workspace using the information that follows.

Reader Format MapInfo TAB (MITAB)
Reader Dataset C:\FMEData2015\Data\Parks\Parks.tab
Writer Format Format MapInfo TAB (MITAB)
Writer Dataset C:\FMEData2015\Output\Training

2) Update Attributes
FME creates a workspace where the destination schema matches the source. However, the end user of the data has requested the attributes get cleaned up so that unnecessary information is removed. Also others need to be renamed and some extra ones added to store the calculation results.

Open the Feature Type Properties dialog for the writer feature type by clicking the Properties button. Click the User Attributes tab to open a list of the destination attributes. It will look like this:

In turn, carry out the following actions:

Delete Attribute RefParkID
Delete Attribute EWStreet
Delete Attribute NSStreet
Delete Attribute Washrooms
Delete Attribute SpecialFeatures
Delete Attribute DogPark
Rename Attribute from: NeighborhoodName to: Neighborhood
Add Attribute ParkArea type: Float
Add Attribute AverageParkArea type: Float

After these edits the attribute list should look like this:

3) Rename Feature Type
Now click back on the General tab.

Click in the field labelled Table Name (remember this label is format-specific and in MapInfo we deal with "tables") and change the name from Parks to ParksMaintenanceData.

Click OK to accept these changes.

Now when the workspace is run the output will be named ParksMaintenanceData.tab

4) Un-Expose Source Attributes
The workspace will now look like this:

Notice there are several source attributes that are not going to be used in the workspace or sent to the output. We can tidy the workspace by hiding these.

Open the Feature Type Properties dialog for the Reader feature type by clicking the Properties button. Click the User Attributes tab to open a list of the source attributes. It will look like this:

Uncheck the check box for the following attributes, which we do not need:

  • RefParkID
  • EWStreet
  • NSStreet
  • Washrooms
  • SpecialFeatures

This is basically the list of attributes we deleted, except for DogParks, which we will make use of in the translation.

Click OK to close the dialog.

5) Save the Workspace
Save the workspace – it will be completed in further examples. It should now look like this:

######Tip There is nothing yet to map to ParkArea or AverageParkArea because values for them do not yet exist, and Neighborhood is still unconnected, but you can still run the workspace just to see what the output looks like.