PointCloudSplitter: Splitting Point Clouds by Components

Liz Sanderson
Liz Sanderson
  • Updated

FME Version

Introduction

When point cloud datasets are collected, a number of component values are collected for each point as well. This can include information like color, coordinates, elevation, intensity, and classification. Although point clouds contain a large amount of information, sometimes there is no need to have it all. Having to process a large dataset just to analyze a single type of feature within it is inefficient and time consuming. The PointCloudSplitter transformer is useful for dissociating the features of interest in the point cloud from the rest of the points.

The examples below demonstrate how the PointCloudSplitter can be used in different scenarios. To learn more about the PointCloudSplitter, visit the documentation page.

 

Step-by-step Instructions

Splitting by Return Number

When point cloud data is collected, a laser point is sent towards the earth and reflected back towards the sensor. Sometimes there are multiple returns for the one laser pulse that is sent. These pulses are counted and given a return number. More reflective surfaces tend to have more returns than non-reflective surfaces. With the PointCloudSplitter, there are four options for how to split a point cloud by return: return, number_of_returns, First Return Only, or Last Return Only. The steps below demonstrate how to split the points by return:

  1. Add an LAS ASPRS reader with default parameters and add the point cloud data
  2. Add a PointCloudSplitter. In the parameters, set “Split By” to “return”, “Split Type” to Unique and “Output Attribute” to “_returns”.

    returns-pointcloudsplitter.jpg

  3. A maximum of 5 returns will be collected by a sensor, so we will now add 5 Tester transformers, each connected to the Split output port. Each transformer will have the “Left Value” set to “_returns”, “Operator” to = and “Right Value” as either 1, 2, 3, 4, or 5.

    returns-tester.jpg

  4. Each output passed through the Testers can be viewed in the Data Inspector.

a. -return-source.jpg b. -return-one.jpg

c. -returns-two.jpg d. -returns-three.jpg

Image a. shows original point cloud read as an LAS feature type in the Data Inspector while images b., c., and d. show the first, second and third return points respectively.

 

Splitting by Classification

Splitting a point cloud by class can be very useful if you are interested in a one or many features. The classification values are assigned based on the standard ASPRS classification values.

Since this type of operation is common, a Safe staff member created a simple custom transformer called PointCloudLASClassifier to make the operation even more efficient. It is essentially one large TestFilter that is preset to know what values to look for. This means you will not have to manually add and set up Tester or TestFilter transformers as was done in the previous example. The steps to use this transformer are as follows:

  1. Add an LAS ASPRS reader with default parameters and add the point cloud data
  2. Add a PointCloudSplitter. In the parameters, set “Split By” to “classification”, “Split Type” to Unique and “Output Attribute” to “_classification”. The Output Attribute must have this name because the PointCloudLASClassifer is set up to read the attribute “_classification”.

    class-pointcloudsplitter.jpg

  3. Add the PointCloudLASClassifier. Since this is a custom transformer it will have to be installed first. This can be done by downloading the transformer (above), and double-clicking it. After the installation, you will be able to add it to the workspace like you would any transformer.
  4. The point cloud has now been split according to class and can be further manipulated, written as a new point cloud file, or viewed in the Data Inspector. In the template file, inspectors are only attached to the classes that exist in the original LAS file. If you are using your own LAS dataset you may have more or fewer classes.

a.-class-source.jpg b. -class-ground.jpg

c.-class-highveg.jpg d. -class-building.jpg

Image a. shows the original point cloud read as an LAS feature type in the Data Inspector while image b. shows the points classified as ground (2), image c. shows the points classified as high vegetation (5), and image d. shows the points classified as buildings (6).

 

Splitting by Class and Elevation

This next example is more complex as we will be using two PointCloudSplitter’s and an orthophoto to provide additional colouring to the resulting point cloud. Depending on your needs, you may be interested in only a certain class of points as well as another components like intensity, elevation, colour, etc. Further manipulation of colour can help to distinguish differences or areas of focus. To learn how this can be done, follow the steps below:

  1. Add an LAS ASPRS reader with default parameters and add the point cloud data
  2. Add a PointCloudSplitter transformer and change the parameters so that “Split By” is set to “classification”, “Split Type” is set to “Unique” and “Output Attribute” is set to “_ground”. In the “Unique Values to Keep” table, add the value 2 which is the classification value for the ground. This will ensure that our only output from this transformer are ground points.

    ground-pointcloudsplitter1.jpg

  3. We will now split the ground points that we found by elevation. Add a second PointCloudSplitter transformer and connect the previous split points to the input port. Change the parameters so that “Split By” is set to “z”, “Split Type” is set to “Range” and “Output Attribute” is set to “_z”. The z component represents elevation. We will split the ground points into three categories: from 0 to 5, 5 to 20, and 20 to 50.

    ground-pointcloudsplitter2.jpg

  4. We will now add three Tester transformers, each connected to the previous output. Each transformer will have the “Left Value” set to “_z”, “Operator” to = and “Right Value” as either 0..5, 5..20, or 20..50.
  5. Now add three new PointCloudOnRasterComponentSetter transformers, one for each Tester. We will focus on the PointCloudOnRasterComponentSetter for the low elevation range first.
  6. In this example we would like to highlight the low elevation range by using an orthophoto to colour these points. To do this, attach the low elevation tester to the PointCloud input.
  7. Add a GeoTIFF reader with default parameters to add the orthophoto. Attach this reader to the Raster input.
  8. Now in the PointCloudOnRasterComponentSetter, change the Components as being set to “Color”.
  9. We will now add the RasterRGBCreator transformer and connect this to the Raster input for both the medium and high elevation PointCloudOnRasterComponentSetters.
  10. For the medium elevation PointCloudOnRasterComponentSetter, connect the medium elevation Tester output to the PointCloud input port. Change the parameters so that under Components there are 3 bands (0, 1, and 2) with Components color_red, color_green, and color_blue respectively. Change the Default Values to 75, 0 and 130 respectively.

    ground-pointcloudonrastercomponentsetter.jpg

  11. For the high elevation PointCloudOnRasterComponentSetter, connect the high elevation Tester output to the PointCloud input port. Change the parameters so that under Components there are 3 bands (0, 1, and 2) with Components color_red, color_green, and color_blue respectively. Change the Default Values to 25, 25 and 112 respectively.
  12. To put all the changed point clouds together, add the PointCloudCombiner. Keep the default parameters and connect each of the three PointCloud outputs from the PointCloudOnRasterComponentSetters to the input port. You can now use a writer to save the altered point cloud or you can view the output in the Data Inspector.

a. -class-source.jpg b. ground-low.jpg

c. ground-photo.jpg d. ground-out.jpg

Image a. shows the original point cloud read as an LAS feature type in the Data Inspector while image b. shows the ground classified points with z values ranging from 0-5 which were obtained by using two PointCloudSplitter transformers. Image c. shows what the orthophoto of the same area looks like and image d. shows what the result of colour manipulation looks like on the ground classification points.

To learn more about change point cloud colours, please visit our article Colour and Point Clouds.

 

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?

Comments

0 comments

Please sign in to leave a comment.