Files
-
- 600 KB
- Download
Introduction
Creating polygons in FME can be accomplished by using a polyline or line features, such as a street network, and the AreaBuilder transformer. Since a street network is a set of topologically connected linework, the AreaBuilder can create polygon features from lines connected by vertices/endpoints that form shapes (i.e., closed polygons). However, areas can also be created from disconnected line features using the LineCloser.
Source Data
The source data is an Esri Shapefile containing all of the roads in the City of Vancouver.
Step-by-step Instructions
In this tutorial, you will create polygons for city blocks from a street network that consists of Arterial, Residential, Private, and Non-city streets using the AreaBuilder.
1. Create a New Workspace
Open FME Workbench and create a blank workspace.
2. Add an Esri Shapefile Reader
Add an Esri Shapefile reader to the canvas by clicking on the Reader button on the top menu bar or by going to Readers > Add Reader. In the Add Reader dialog, select Esri Shapefile as the Format, then for Dataset, browse to the Roads.shp dataset which is available for download from the Files section of this article. Then click OK to finish adding the reader.
3. Create Polygons
Click on the Roads reader feature type to select it. Then add an AreaBuilder transformer to the canvas by typing “AreaBuilder” to bring up the list of FME Transformers in the Quick Add Search. Select the AreaBuilder from the list of Transformers by double-clicking or by using the arrow keys and the Enter key to add it.
Double-click on the AreaBuilder to open the parameters. In the parameters, deselect the Create Donuts option. Next, expand the Snapping Pre-Processing section, change the Snapping Type to End Point Snapping, and set the Snapping Tolerance to 8.
Snapping tolerance is measured in map units, which in this case is meters.
4. Run Workspace
Connect an Inspector transformer to the Area output port on the AreaBuilder.
Run the workspace by clicking the Run button on the top toolbar, or by selecting Run > Run Workspace from the top menu bar.
After running the workspace, the output will be opened in Visual Preview. Click on a feature and note that the entire block is a single feature, whereas in the input dataset, it was multiple line segments.
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.