Re-classifying a Point Cloud in FME

Liz Sanderson
Liz Sanderson
  • Updated

Introduction

This article demonstrates how to set up and work with a point cloud’s classification component. The previous articles in this series demonstrated how to set the colour and intensity components.

To understand the basics of working with point clouds in FME, see Getting Started with Point Clouds and Point Clouds (IFMEPointCloud) documentation. Key transformers for setting component values include the PointCloudOnRasterComponentSetter, which sets them based on an overlaid raster, and the PointCloudExpressionEvaluator, which sets them based on expressions or conditional statements.

The goal of this scenario is to correct a point cloud’s classification values. Sometimes, points can be misclassified since they are based on algorithms. If you have a dataset containing related information, such as building footprints, you can use it to correct misclassified points—for example, by setting all points within building footprints to 6 (which means “buildings” according to the ASPRS LAS Specification).

Data Source

Our source data includes a point cloud in LAS format (left image) and an orthophoto in MrSID format (right image).

source data.png

Step-by-Step Instructions

In this scenario, we will correct the misclassification between ground (class 2) and low vegetation (class 3) using pixel values from an orthophoto. 

We will use raster expressions to determine the color of each pixel in the orthophoto and assign it the correct class. We will use the PointCloudOnRasterComponentSetter to set the class in the output point cloud.

1. Open the starting workspace in FME Workbench

Download the tutorial attachments, and open PointCloudReclassification_Start.fmwt to follow along. The workspace has two readers: a LAS point cloud and a MrSID raster. These are connected to a PointCloudOnRasterComponentSetter transformer to colorize the point cloud using the orthophoto colors, and to a PointCloudComponentTypeCoercer to set the point cloud’s RGB color values to UInt8.

start.png

The point cloud looks like this after passing through these transformers:

start workspace output.png

With the point cloud colorized, we can now work on re-classifying it.

2. Add a PointCloudSplitter

First, split the point cloud by classification. Add a PointCloudSplitter transformer, and connect it after the PointCloudComponentTypeCoercer.

splitter.PNG

Open the parameters. Set “Split By” to “classification”, and “Split Type” to “Unique”.

The point cloud will be split by the classification, and a new point cloud will be created for each unique classification type. The classification value for each new point cloud will be stored in an attribute called “_classification”. The output from this transformer looks like this in Visual Preview:

splitter output.PNG

Note how we have a point cloud for class 2, another for class 1, and another for class 5.

3. Add a Tester

Next, separate the ground points from the rest of the point cloud. Add a Tester transformer, and connect it to the previous transformer.

Tester.PNG

Open the parameters. Add one Test Clause to check if the classification is 2: 

  • Left Value: _classification
    • Operator: =
    • Right Value: 2

Tester params.PNG

The points with classification 2, i.e., ground points, will go through the “Passed” output port, while the rest of the points, i.e., buildings and vegetation, will go through the “Failed” output port.

Below is the output from the "Passed" port—note how it includes only the points with a classification of 2:

tester passed output.PNG

4. Add a RasterBandNodataRemover and a RasterExpressionEvaluator

Next, use a raster expression to check the color of each orthophoto pixel and set the classification accordingly.

After the MrSID reader, add two transformers to pre-process the MrSID orthophoto: a RasterBandNodataRemover to make any “Nodata” cells valid, followed by a RasterExpressionEvaluator.

Raster.PNG

Open the RasterExpressionEvaluator parameters, and add the following Band Expression:

  • Interpretation: Preserve
  • Expression: if(A[1]-A[0]>=7 && A[1]-A[2]>=7 && A[1]<150,3,2)

ree params.PNG

This expression checks each pixel's color. It assigns green pixels to class 3 (vegetation) and other colors to class 2 (ground).

5. Add a PointCloudOnRasterComponentSetter

Overlay the ground points (class 2) identified with the prepared orthophoto. Add another PointCloudOnRasterComponentSetter. Connect the Tester’s “Passed” output to the “PointCloud” input. Connect the RasterExpressionEvaluator “Result” output to the “Raster” input.

PCORCS2.PNG

Open the parameters, and set “Components to Set” to “Custom”. Add one band as follows:

  • Band: 0
  • Component: classification
  • Default value: 2

Also set “Interpolation Type” to “Nearest Neighbor” so it doesn’t assign calculated average values to the points.

PCORCS2 params.PNG

This will refine the point cloud by correcting points with incorrect classifications.

6. Add a PointCloudCombiner

Add a PointCloudCombiner transformer. Connect both the “Failed” output port from the Tester and the “PointCloud” output from the PointCloudOnRasterComponentSetter to the input port of the PointCloudCombiner.

pointcloudcombiner.PNG

7. Connect an Inspector

Connect an Inspector so we can view the output in Visual Preview. The final workspace looks like this:

final workspace.PNG

8. Run the Workspace

Run the workspace. The output from this transformer will look identical to the original point cloud, but the classification of ground and low-vegetation points will be more accurate.

final output.PNG

Bonus: Highlighting a specific classification value

Open the workspace PointCloudReclassification_Bonus.fmwt to see an expanded version of this workspace that outputs a point cloud highlighting all points with a specific classification – in this case, 3 (low vegetation).

In the bonus part of the workspace, the PointCloudSplitter splits the point cloud by classification values, and the Tester checks for points where _classification = 3. The RasterRGBCreator creates a 1x1 raster that we’ll use in the PointCloudOnRasterComponentSetter. The PointCloudOnRasterComponentSetter then sets points of class 3 (low vegetation) to bright green.

bonus.PNG

The output looks like this:

bonus output.png

Left: Original point cloud. Right: With “low vegetation” points (class 3) coloured bright green.

Data Attribution

The data from these exercises originates from data made available by the Ohio Geographically Referenced Information Program. The GIS Support Center maintains enterprise and site licenses for commercial data sets that support the Ohio Enterprise.

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.