In this tutorial we will make use of the AreaOnAreaOverlayer transformer.
We will explore how FME can be used to overlay two or more polygons to determine and extract
the area in which they overlap.
Let's look at our data using the FME Data Inspector.
We will make use of zoning data stored in MapInfo TAB format that includes attributes
for zone category
We will also use neighborhood data stored in Google KML format that is tagged with the
NeighborhoodName attribute
For our exercise we will determine the percentage of land in the Kitsilano neighborhood that
is zoned for commercial use.
The workspace will measure the neighborhood area, overlay it against the commercial zones,
and calculate the area of the data extracted.
Open FME Workbench and create a new workspace.
Add a MapInfo TAB reader and select the zones dataset.
Add a Google KML reader and select the neighborhoods KML dataset.
When prompted, select only the neighborhoods layer.
Add two Tester transformers.
Connect one to the Zones and the second to Neighborhoods.
For the Tester connected to zones, open its parameters and set it to test where ZoneCategory
equals "commercial"
For the Tester connected to neighborhoods, opens its parameters and set it to test where
NeighborhoodName equals "Kitsilano".
Let's also add a Reprojector to the canvas, and attach it to the neighborhood Tester:Passed
port.
This is necessary because the neighborhood data is stored as latitude/longitude.
Since our zoning data is UTM83-10, this transformer will reproject them to a common coordinate
system.
Add an AreaOnAreaOverlayer and connect it to the Tester and Reprojector.
Attach an Inspector transformer and run the translation.
Inspect the output features.
You will notice a newly created attribute called _overlaps.
Let's revise our workspace so that we can clearly see the polygons where an intersection
occurs.
Add another Tester between the AreaOnAreaOverlayer and Inspector transformers.
Set it to test for where _overlaps are greater than one.
A number of two or higher denotes an intersection of multiple polygons.
Go ahead and run the workspace again.
The result will be polygons that show only the intersection of the Kitsilano neighborhood
with commercial-use zoning.
But we can continue to improve our workspace by including some additional steps.
Let's calculate the area of the intersected polygons as a percentage of the entire Kitsilano
neighborhood.
To do this add an AreaCalculator transformer to the canvas.
Make sure to place the AreaCalculator after the Reprojector, or else its measurement units
will be calculated in decimal degrees.
Set it to store the area of the neighborhood in an attribute called KitsilanoArea.
Add another AreaCalculator transformer after Tester_3, to calculate the area of the intersections.
Set it to store the area of these features in an attribute called IntersectedArea.
Add a StatisticsCalculator transformer and connect it to our second AreaCalculator.
Drag and drop the connector from the Summary output port to the Complete output port.
Open the parameters and set it to analyze the intersected area attribute.
Delete all of the attributes to be calculated except for the sum attribute.
Write the sum to an attribute called TotalIntersectedArea.
Finally add an ExpressionEvaluator transformer behind the StatisticsCalculator.
Open the parameters dialog and set it up to calculate the total intersected area as a
percentage of the original Kitsilano area.
Go ahead and run the translation again.
The output will include new attribute fields for IntersectedArea, TotalIntersectedArea,
and _result.
You will see that 11.8% of the land in Kitsilano neighborhood is zoned for commercial use.