How to Find a Polygon Within a Distance of Selected Features

Liz Sanderson
Liz Sanderson
  • Updated

Introduction

Typically, selecting by location is done through a graphical user interface such as ArcMap or QGIS. However, in FME, you can perform the same task by querying your data with a Tester to “select” the desired feature(s), then select the features that pass the query using the NeighborFinder.

Data Source

The first source is a feature class from the Community geodatabase and contains schools in the City of Vancouver. 

SchoolsSource.png

The second source is an Esri Shapefile containing parcel polygons in the City of Vancouver. 

ParcelSource.png

Step-by-step Instructions

In this scenario, you will learn how to query the school's dataset in order to select parcel polygons within 200m of King George Secondary and Henry Hudson Elementary.

To follow along with this tutorial, please download the source files from the Files section of the article.

1. Create a New Workspace

Open FME Workbench and create a blank workspace. 

NewWorkspace.png

2. Add an Esri Geodatabase (File Geodb Open API) 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: 

Click OK to open the Select Feature Types window.

Geodb.png

In the Select Feature Type dialog, select Schools, then click OK twice to finish adding the reader. 

SelectFT.png

3. Add Parcels Esri Shapefile Reader

Next, add another reader to the canvas and set the following:

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

Click OK to add the reader to your canvas.

Shape.png

4. Filter Schools

Now we need to filter for the schools we are interested in. Click on the Schools reader feature type to select it. Then add a Tester to the canvas by typing “Tester” to bring up the list of FME Transformers in the Quick Add Search. Select the Tester from the list of Transformers by double-clicking or using the arrow keys and Enter to add it. 

QuickAdd.png

Double-click on the Tester to open the parameters. In the parameters, we need to set up an OR test for the two schools. Set the following test clauses:

  • Left Value: school_name
    • Operator: Begins With
    • Right Value: King George
  • Logic: OR
  • Left Value: school_name
    • Operator: Begins With
    • Right Value: Henry

The parameters should look like the image below. Click OK to accept the parameters and add the transformer to the canvas.

Tester.png

5. Find Neighboring Parcels

Add a NeighborFinder to the canvas and connect the Candidate input port to the Tester Passed output port. Then connect the Base input port to the Parcels reader feature type. This will result in the connection lines crossing. To fix this, right-click on the Base port and select Move Down. 

MoveDown.png

Connection.png

In the NeighborFinder parameters, set the Maximum Distance to 200. This value is in map units, but since our coordinate system is UTM83-10, the units are in meters. 

NeighborFinder.png

6. Run Workspace

Connect an Inspector transformer to the MatchedBase output port on the NeighborFinder. 

Inspector.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, the polygons within a 200-meter radius of each school will be selected. 

Output.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.