Extracting Polygon Intersections with the AreaOnAreaOverlayer

Liz Sanderson
Liz Sanderson
  • Updated

FME Version

  • FME 2020.0

Introduction

A common GIS operation is to overlay two (or more) polygons to determine, and extract, the area in which they overlap.

For example, I might have a dataset of polygons representing land parcels owned by the army. I also have a dataset of polygons representing land that is protected as a wildlife reserve. By overlaying the two I can discover which areas of land owned by the army are also wildlife reserves; i.e. where these are sets of data intersect.

FME has several transformers that will overlay data, but to actually extract the overlapping areas as new polygon features requires the use of the AreaOnAreaOverlayer transformer.

 

Video

 

Source Data

The source datasets for these examples are a vector polygon dataset of zoning data in MapInfo TAB format, and a vector polygon dataset of neighborhoods in Google KML format.

In the FME Data Inspector they look like this (left, zoning; right, neighborhoods):

spatialintersection.png

This example is a simple exercise to discover the percentage of land in the neighborhood of Kitsilano that is zoned for commercial use. The workspace will measure the area of the Kitsilano neighborhood, overlap it against the commercial zones, and calculate the area of the data extracted.

 

Step-By-Step Instructions

1. Start FME Workbench and begin with an empty canvas. Select Readers > Add Reader from the menubar.

Set the data format to MapInfo TAB (MITAB). Select the attached dataset as the source.

2. Once more select Readers > Add Reader from the menubar. This time set the format to Google KML and select the attached KML dataset as the source. When prompted, de-select all the feature types in the list and re-select only the Neighborhoods layer.

3. Add a Tester transformer to each of the feature types, add a Reprojector connected to the Neighborhood data's Tester:Passed port, and add an AreaOnAreaOverlayer connected to both the first Tester and Reprojector. The workspace will now look like this:

spatialintersection12.png

4. Open the parameters dialog for the first Tester. Set it up to test where ZoneCategory = Commercial

spatialintersection3.png

Open the parameters dialog for the second Tester. Set it up to test where NeighborhoodName = Kitsilano

spatialintersection4.png

5. Open the parameters dialog for the Reprojector. Set it up to reproject to the coordinate system UTM83-10:

spatialintersection6.png

This is required because KML data is in a latitude/longitude coordinate system, whereas the zoning data is not. This transformer will reproject them to a common coordinate system.

6. Attach an Inspector transformer to the AreaOnAreaOverlayer:Area port and run the translation. Inspect the output features by querying them. You will notice an attribute called _overlaps. A number of 2 (or higher) denotes an intersection of multiple polygons.

7. Add a Tester transformer between the AreaOnAreaOverlayer and Inspector transformers. Set it up to test where _overlaps > 1

8. Re-run the workspace. The result will be a set of polygon features showing the intersection of the Kitsilano neighborhood with commercial-use zoning:

spatialintersection7.png

The original intention was to create a workspace that calculated the area of these features as a percentage of the entire Kitsilano neighborhood. To do so uses techniques beyond plain intersection, so the remaining steps are optional.

9. Add an AreaCalculator transformer to calculate the area of the Kitsilano neighborhood. It must come after the Reprojector, else the measurement units will be decimal degrees!

spatialintersection13.png

Set it up to store the area of the neighborhood in an attribute called KitsilanoArea.

10. Add a second AreaCalculator transformer to calculate the area of the intersections. It should be right at the end of the workspace:

spatialintersection14.png

Set it up to store the area of these features in an attribute called IntersectedArea.

11. Add a StatisticsCalculator transformer at the end of the workspace. Open the parameters and set it up to analyze the IntersectedArea attribute, and write the sum of these attributes as TotalIntersectedArea:

spatialintersection10.png

12. Finally add an ExpressionEvaluator transformer to the StatisticsCalculator:Complete output port.

Open the parameters dialog and set it up to calculate TotalIntersectedArea as a percentage of the original KitsilanoArea:

spatialintersection11.png

13. Re-run the translation. The output should report that the percentage of Kitsilano that is zoned for commercial use is 11.8%.

 

 

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.