Thinning and Combining Point Clouds

Liz Sanderson
Liz Sanderson
  • Updated

FME Version

Introduction

In this article, we will be focusing on two transformers called the PointCloudCombiner and PointCloudThinner. The PointCloudCombiner can be used with both point cloud and other file formats to output a new point cloud. The PointCloudThinner is useful for removing points in order to reduce the file size of the output point cloud. Below are three examples that demonstrate how these transformers can be used together or on their own in FME Workbench.

 

Video

This video demonstrates the PointCloudCombiner and PointCloudThinner transformers available in FME. Combining and thinning are common functions for processing LiDAR data. Thinning reduces the number of points in a uniform way, helping to manage the size of very large datasets. Combining merges multiple geometries together into a single point cloud, and can also be used to automatically convert a raster DEM to a point cloud. This video was recorded in an older version of FME and the instructions may differ from the article.

 

Downloads

Due to the large filesize of the point clouds, each dataset will need to be downloaded separately from the City of Vancouver's Open Data Portal. Optionally, you can copy and paste the FTP URLs directly into the LAS reader, instructions shown in Part 1 Step 1B.

Data:

ftp://webftp.vancouver.ca/opendata/2013LiDAR/COV_4890E_54570N.zip

ftp://webftp.vancouver.ca/opendata/2013LiDAR/COV_4900E_54570N.zip

ftp://webftp.vancouver.ca/opendata/2013LiDAR/COV_4890E_54580N.zip

ftp://webftp.vancouver.ca/opendata/2013LiDAR/COV_4900E_54580N.zip

These four datasets can also be found in the Point Cloud folder of the FMEData training datasets.

Workspaces:

PointCloudThinning.zip Contains Part 1, 2, and 3 workspaces as well as data for Part 3.

 

Step-by-step Instructions

Part 1: Combining Point Clouds

The PointCloudCombiner transformer can be used to combine multiple point clouds that may be tiled or overlapping into a single point cloud. To build this example, follow the steps below:

 

1. Open FME Workbench and Add a Reader

In FME Workbench, start with a blank workspace and add an ASPRS Lidar Data Exchange Format (LAS) reader to the canvas.

For the Dataset, click on the ellipsis and browse to the Data folder included in the downloads. Hold Shift and click all four of the .las files, once all four are selected, click OK. Click OK again to add the reader.

lasreader.png

 

If you run the workspace and inspect the output of the reader feature type, you will see four separate datasets. We will need to combine these into one.

initialvp.png

 

1.B. Use FTP URLs in the Reader

If you want to skip downloading the data, as the file sizes are large, you can use the FTP URLs directly inside the reader. In the LAS reader, for dataset, copy and paste each FTP URL separated by a comma and then click OK to add the reader. Ensure that you run the workspace before trying to view the data. When using FTP URLs, it is a good idea to use feature caching so the data doesn't need to be pulled from the internet each time.

Paste the following into the reader Dataset to use all four URLs:

ftp://webftp.vancouver.ca/opendata/2013LiDAR/COV_4890E_54570N.zip, ftp://webftp.vancouver.ca/opendata/2013LiDAR/COV_4900E_54570N.zip, ftp://webftp.vancouver.ca/opendata/2013LiDAR/COV_4890E_54580N.zip, ftp://webftp.vancouver.ca/opendata/2013LiDAR/COV_4900E_54580N.zip

When pasting the above text, remove the quotations " from the start and end.

 

2. Add a PointCloudCombiner

If we were to add a LAS writer to write the files out directly without using a transformer, we would end up with four separate output files. To join them into a single file, we need to use the PointCloudCombiner.

Add a PointCloudCombiner transformer to the canvas and connect it to the LAS reader feature type. There are lots of parameters that can be changed in the PointCloudCombiner, but since we are doing just a simple combine, we can leave the parameters as the defaults.

 

3. Add a LAS Writer

Now we can write out the combined point cloud. Add an ASPRS Lidar Data Exchange Format (LAS) writer to the canvas. Browse to a location to save the dataset. Set the LAS File Definition to Automatic. Click OK to add the writer.

laswriter.png

 

In the Feature Type dialog, change the LAS File Name to Vancouver-Downtown. Click OK.

lasfeaturetype.png

 

4. Run the Workspace

Connect the Vancouver-Downtown writer feature type to the PointCloudCombiner. Once connected, run the workspace. Once the workspace has finished running, click on the Vancouver-Downtown writer feature type to open the popup menu. On the popup menu, click View Written Data to view the data in Visual Preview.

part1viewsource.png

 

You can see that the four LAS files have been joined into a single file.

outputvp.png

 

You can confirm this by looking at the output folder. There should only be a single Vancouver-Downtown.las file.

finalfile.png

 

Save the workspace as it will be used in the next example.

 

Part 2: Thinning Point Clouds

Continuing from the first example, the point clouds can be thinned before they are combined to produce a point cloud with fewer points and ultimately a smaller file.

 

1. Open the Workspace from Part 1

Continuing in the workspace from part one, we will thin the point clouds to reduce our file size. When running the workspace before adding the PointCloudThinner, there are 75,145,670 points in the point cloud, and the file size is 2,054,765 KB, which takes about a minute to run. We don’t need to keep the detailed point cloud so we can remove some of the points.

 

2. Add a PointCloudThinner

Add a PointCloudThinner to the canvas and connect it between the LAS reader feature type and the PointCloudCombiner.

pct.png

 

In the parameters, set the Interval to 5. This way we will keep every fifth point.

pctparams.png

 

3. Run the Workspace

Now run the workspace, take note about how much faster the workspace runs. This time it only took 24 seconds, and we now have 4,293,232 points with a file size of 410,954 KB. If you view the point cloud before and after thinning, it looks slightly different, but all of the key detail is there.

finalpc.png

 

Note: Workspace runtime will vary for each computer.

 

Part 3: Combining a Raster DEM into a PointCloud

The PointCloudCombiner can also combine other kinds of geometries such as rasters, polygons, and even surfaces and output them as a point cloud. For this example, we will read in a raster digital elevation model (DEM) and transform it into a point cloud.

 

1. Open FME Workbench and Add a Reader

In a blank FME workspace, add a Canadian Digital Elevation Data (CDED) reader to the canvas. Browse to the DEM-Clipped.dem dataset, then click OK to add the reader.

cdedreader.png

 

Click on the CDED reader feature type to open the popup menu, then click on the View Source Data button to view the data in Visual Preview.

cdedviewdata.png

 

Here we have a digital elevation model of Vancouver, BC.

demvp.png

 

2. Add a PointCloudCombiner

Now, add a PointCloudCombiner to the canvas and connect it to the reader feature type. By default, the PointCloudCombiner transformers the raster pixel location into the x/y component and the pixel value into the z component of the resulting point cloud.

 

3. Add a LAS Writer

Now we can write out the newly created point cloud. Add an ASPRS Lidar Data Exchange Format (LAS) writer to the canvas. Browse to a location to save the dataset. Set the LAS File Definition to Automatic. Click OK to add the writer.

laswriter.png

 

In the Feature Type dialog, change the LAS File Name to Vancouver. Click OK.

dem-las.png

 

4. Run the Workspace

Connect the Vancouver writer feature type to the PointCloudCombiner. Once connected, run the workspace and inspect the output.

In Visual Preview, you can see that a point cloud has been created.

dempointcloud.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?

Comments

0 comments

Please sign in to leave a comment.