FME Version
Files
Introduction
This tutorial will show you how to transform zoning data from MapInfo MITAB (*.tab) to Esri Shapefile (*.shp). We will filter the data so that only the zones representing residential dwellings will be written to shapefile.
Video
This video was created with FME version 2016.0. Some of the steps might be slightly different, but the overall process is the same for newer versions of FME.
Step-By-Step Instructions
1. Inspect the Data in FME
The first step is to inspect the Zones.tab file. Open a blank FME Workspace and add a new reader. In the reader dialog, type in MapInfo TAB (MITAB), then browse to the Zones.tab file. Click OK to add the reader to the canvas.
Now to view the data, click on the Zones reader feature type on the canvas to open the popup menu. Then on the popup menu click the View Source Data button to view the data in the Visual Preview Window.
In the Visual Preview window (or FME Data Inspector), look through the ZoneCategory, we are interested in only residential zones, so any attributes that contain the word Dwelling.
Note: This step can also be completed in FME Data Inspector for versions previous to FME 2019. Just be sure to add the MapInfo TAB (MITAB) reader to FME Workbench after inspecting the data.
2. Set the Output (Writer) Format to Esri Shapefile
Next, we need to add a writer to the canvas. Click on the Add Writer and in the Add Writer dialog box, for the Format, select Esri Shapefile. Then for Dataset, browse to a folder to save the shapefile and then click OK to add the writer.
3. Update Writer Properties
Connect the Zones reader feature type to the Zones writer feature type. Then open up the Zones writer parameters. In the Feature Type dialog, change the Shapefile Name to Dwellings.
Next, switch to the User Attributes tab. We will have to shorten the ZonesCategory attribute name since we are writing to shapefile because there is a 10 character attribute name limit. In the User Attributes tab, change ZoneCategory to Category. Then click OK to close the Feature Type dialog.
4. Fix Attribute Mapping
Since we changed the attribute name to Category in the writer, we will need to update the attribute mapping so that the attributes coming from the reader know which attribute to write to in the writer. To do this, we will use an AttributeManager transformer. Add an AttributeManager transformer to the canvas and connect the input port to the Zones reader feature type and the output to the Dwellings writer feature type.
Open the AttributeManager parameters and change the following Output Attributes:
Input Attribute |
Output Attribute |
---|---|
ZoneCategory |
Category |
To double-check that the attributes were mapped correctly, click on the arrow on the writer feature type to expand the attributes. When the attributes are mapped correctly, all of the attributes will have a green arrow next to them. If they are mapped incorrectly, the arrow will be red.
5. Add a Tester Transformer
Now we will add a Tester transformer to test for any of the Category attributes containing the word Dwelling.
Add the Tester between the AttributeManager and the Dwelling writer feature type. Be sure to connect the writer feature type to the Passed output port on the Tester.
In the Tester parameters set the test to:
Category contains Dwelling
6. Run the Workspace
The workspace is now ready to be run. Run the workspace by clicking on the green play button.
7. View the Output Dataset
To view the output dataset, click on the Dwelling writer feature type to open the popup menu, then click on the View Written Data button.
In Visual Preview, you should have 90 features all containing the word Dwelling.
Data Attribution
The data used here originates from open data made available by the City of Vancouver, British Columbia. It contains information licensed under the Open Government License - Vancouver.
Comments
0 comments
Please sign in to leave a comment.