Select Data by Area Masks

Liz Sanderson
Liz Sanderson
  • Updated

Introduction

Extracting data using area masks in FME requires both a raster and a vector dataset, as well as the Clipper transformer. In this tutorial, you will select raster data within polygon features; however, it can easily be modified to select vector features within a search envelope.

Data Sources

The first source dataset is a digital elevation model of the City of Vancouver and the surrounding area. 

DEMSource.png

The second source dataset is an Esri Shapefile of the City of Vancouver boundary. 

BoundarySource.png

Step-by-step Instructions

In this scenario, you are interested in clipping the extent of an existing DEM to the boundary of your city based on a polygon feature. This exercise uses a municipal land boundary as the search envelope; however, you can also use multiple polygon features.

To follow along with this tutorial, please download the data from the article's Files section.

1. Create a New Workspace

Open FME Workbench and create a blank workspace. 

NewWorkspace.png

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

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

Click OK to finish adding the reader.

Shapefile.png

3. Add a Canadian Digital Elevation Data Reader

Next, add a second reader to the canvas and set the following:

Click OK to add the reader to the canvas.

DEM.png

4. Inspect Coordinate Systems 

Since we will clip the DEM based on the boundary polygon, we need to ensure that both datasets are in the same coordinate system. 

Click on the VancouverLandBoundary reader feature type to open the mini toolbar, then click on View Source Data to view the data in Visual 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 CDED reader feature type. 

CoordSystem.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 DEM dataset. Click on the CDED 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. 

QuickAdd.png

Repro.png

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

ReproParam.png

 6. Clip DEM 

In FME, the Clipper performs a geometric clipping operation similar to a cookie cutter. With that in mind, we will clip the areas outside of the VancouverLandBoundary polygon because we are only interested in the DEM for the Vancouver area. 

Add a Clipper to the canvas and connect the Clipper input port to the VancouverLandBoundary reader feature type, and then connect the Candidate input port to the Reprojector. We can accept the default parameters for this example. 

ClipperConnect.png

7. Run Workspace

Connect an Inspector transformer to the Clipper's Inside output port. 

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, only the DEM that was inside the VancouverLandBoundary will remain.  

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