Topological Intersection using the SpatialFilter

Liz Sanderson
Liz Sanderson
  • Updated

Introduction

Topological intersection is the process of intersecting multiple polygon layers. In this exercise, you will use the SpatialFilter to set a spatial predicate that will determine which polygon features are merged together. The SpatialFilter compares two sets of features to see if their spatial relationships meet selected test conditions. The features being tested (Candidate features) are identified as having passed or failed the test. For example, if you have a road dataset (lines) and want to extract all the roads that pass through parks (polygons), you would direct the roads into the Candidate input port and the parks into the Filter input port.

Data Source

The first source is an Esri Shapefile containing the Mount Pleasant neighborhood boundary in the City of Vancouver. MountPleasantClipSource.png

The second source is a MapInfo TAB dataset containing parks in the City of Vancouver. 

ParkSource.png

Step-by-step Instructions

In this scenario, you want to merge the MountPleasantClipBoundary and Parks polygon features and their attributes based on the spatial predicate: “Filter OGC - Intersects Candidate.” In this case, the clip boundary is the filter because you only want to extract the park polygons that intersect the MountPleasantClipBoundary - this will also join the attributes of both features.

1. Create a New Workspace

Open FME Workbench and create a blank workspace. 

NewWorkspace.png

2. Add an Esri Shapefile Reader

Add a 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, set the following:

  • Format: Esri Shapefile
  • Dataset: MountPleasantClipBoundary.shp
    • Click on the ellipses to navigate to the location of the file on your computer

Click OK.

Shapefile.png

3. Add a MapInfo TAB Reader

Next, add a second reader with the following parameters:

  • Format: MapInfo TAB (MITAB)
  • Dataset: Parks.tab
    • Click on the ellipses to navigate to the location of the file on your computer

Click OK.

MapInfo.png

4. Inspect Coordinate Systems 

Since we will be performing a spatial join, we need to ensure that both datasets are in the same coordinate system. 

Click on the MountPleasantBoundaryClip reader feature type to open the mini toolbar, then click on View Source Data to view the data in Data Preview. 

ViewSource.png

In Data  Preview, open the Feature Information Window, and select a feature to view the Coordinate System. Repeat this step for the Parks reader feature type. 

Coord.png

The datasets are in different coordinate systems, so we need to convert one of them to match the others.

5. Reproject Coordinates

We will reproject the MountPleasantBoundaryClip dataset. Click on the MountPleasantBoundaryClip reader feature type to select it. Then add a Reprojector to the canvas by typing “Reprojector” to bring up the list of FME Transformers in the Quick Add Search. Select the Reprojector from the list of Transformers by double-clicking or by using the arrow keys and the Enter key to add it. 

Reprojector.png

ReproConnect.png

Double-click on the Reprojector to open the parameters. In the parameters, set the Destination Coordinate System to UTM83-10, then click OK. 

ReproParams.png

If you were to run the workspace now and view both reprojected datasets in Data Preview, you would see the parks within the Mount Pleasant neighborhood. 

ReprojectedVP.png

6. Add a SpatialFilter

Add a SpatialFilter to the canvas, connect the Filter input port to the Reprojector, and connect the Candidate input port to the Parks writer feature type. 

SpatialConnect.png

Open the SpatialFilter parameters and take note of the Spatial Predicates to Test parameter. For this example, we will use the default, which is Filter OGC - Intersects Candidate. Click OK to close the parameters. 

SpatialFilterParams.png

7. Run Workspace

Connect an Inspector transformer to the SpatialFilter's Passed output port. 

WOrkspace.png

Run the workspace by clicking the Run button on the top toolbar, or by selecting Run > Run Workspace from the top menu bar. 

Run.png

After running the workspace, only the parks that are within/intersect the MountPleasantBoundaryClip dataset will be available, and the two datasets will have their attributes merged. 

OutputVP.png

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.

Was this article helpful?

We're sorry to hear that.

Please tell us why.

As of January 14th, 2026, comments on knowledge base articles have been closed. To make sure questions don’t get missed and to enable more community support, we’ve moved discussions to the FME Community. If you have a question or a comment about this article, please create a new post or create a support ticket.