Introduction

Let’s be honest - point clouds can be quite difficult to deal with and they can generate a lot of frustration. It helps to simplify the data that is contained within a LAS file especially if you’re only interested in one part of the giant puzzle. One way to view the information present within a point cloud is to create shapefiles. In the examples below, we demonstrate how to create footprints or boundary polygons around buildings and how to replace trees with a single point. These new shapefiles represent the same area in a visual format that is easier to make sense of.

The examples below show how you can create points and polygons using the classification component in the point cloud data. The results were compared to an orthophoto from the same year to see how accurate they were. Since it is inevitable that there will be some misclassification errors in a point cloud, the resulting shapefiles may also contain errors. If you were to use a different, more complex point cloud than the ones used in the examples, further manipulation may be required. Additionally, due to the nature of LAS datasets, the resulting shapefiles should be used with caution when doing further analysis of the study area.

Building Boundary Polygons

Downloads

Set up

Use an ASPRS LAS reader with default parameters to read in the point cloud data. Set the coordinate system to UTM83-10.

Add a PointCloudFilter and set the expression to @Component(classification)==6 with the Output Port set to “buildings”. Class 6 represents buildings according the the ASPRS classification system. Filtering points isolates the features of interest and helps with processing speed.

Connect a PointCloudCoercer to the output. Set the new Geometry Type in the parameters to “Single Multipoint”.

If you inspect the data after the PointCloudCoercer, all building points have now been converted into a single multipoint feature.

Remove Mis-classifications

Now connect a HullReplacer to the “Coerced” output port. Change the parameters so that Hull Type is set to “Concave )(“ and the Alpha Value is set to 2.5. This transformer will replace the point cloud geometry with a polygon that surrounds the groups of points.

Now that we have separate building outlines, we would like each building to be referenced as an individual feature rather than all being referenced as a single multi-polygon feature. Connect a Deaggregator to the “Hull” output port. The parameters can remain set to the defaults.

We will attempt to remove misclassified points by identifying small (low point density) areas to remove them. Connect an AreaCalculator to the Deaggreagated output. Change the Area Attribute to _area.

After viewing the results of the AreaCalculator in the Data Inspector it was concluded that polygons must be larger than 50 units to be considered buildings. Connect a Tester to “Output” and set the parameters in the Test Clause so that _area must be greater than 50.

The image below shows what the buildings now look like after being buffered and having mis-classified areas removed. We now need to fill the gaps of the buildings.

Fill in Gaps and Smooth Edges

We will again use a Bufferer but this time for the purpose of filling in the gaps in buildings to create a solid polygon. Connect the new Bufferer to the “Passed” Tester results. Set the parameters so that Group By is set to “_part_number”, Buffer Amount is set to 4, End Cap Style is set to “Square”, and Corner Style “Miter”.

Since the above Bufferer also extended the edges of the polygons, we would like to now bring them back. To do this we will connect another Bufferer transformer but apply a negative buffer. Set Group By to “_part_number”, Buffer Amount to -2.5, End Cap Style to “Square” and Corner Style to “Miter”. -2.5 was used instead of -4 which would revert the above change completely because, due to the nature of point clouds, exact boundary lines cannot be created. We would rather overestimate the boundaries than underestimate them to ensure that all building parts are contained within the polygons.

Connect a Generalizer to the buffered polygons to help smooth the edges. Set the Algorithm to “McMaster (Smooth)”.

The final building polygons can now be written to an Esri Shapefile writer with default parameters. There is an orthophoto of this area in the .zip file provided if you would like to use for comparison. You may also view the results over a background map by going to Tool in the menu bar and clicking FME Options. In the new window under Background Map, you can set the Background Format to “Stamen Maps” and choose a map type in the parameters. Other Background Formats may be used with proper authentication.

The image below shows some of the final buildings overtop an orthophoto of the same area. Although the building polygons are very close to representing the actual buildings, there are still some remaining errors that are difficult to pinpoint and remove. These errors will vary depending on the point cloud that is being used in a workflow such as the above example. Further iterations of buffering and testing may be necessary.

Tree Points

Downloads

Set up

Use an ASPRS LAS reader with default parameters to input the point cloud data. Set the coordinate system to UTM83-10.Add a PointCloudFilter and set the expression to @Component(classification)==5 with the Output Port set to “Trees”. Class 5 represents “High Vegetation” aka. trees), so this will ensure that the rest of our workflow only uses points classified as trees.

Connect a PointCloudCoercer to the filter output. Set the new Geometry Type in the parameters to “Single Multipoint”. All tree points have now been converted into a single multipoint feature.

Clip to Buildings

We will use the HullAccumulator to create polygons that represent either individual trees or a group of trees. Open the HullReplacer parameters and set Hull Type to “Concave )(“ and Alpha Value to 2.

We will use the buildings that we wrote in the previous example to help clip the buffered tree areas. This is done to ensure that when we later identify points for the trees they will not accidentally be put inside of a building polygon. Read in the building polygon with an Esri Shapefile reader with default parameters.

Add a Clipper transformer. Connect the building shapefile to the “Clipper” input port and then “Buffered” trees to the “Clippee” input port.

Now we would like each polygon to be individual features rather than a multi-polygon feature. Connect a Deaggregator to the “Hull” output port. The parameters can remain set to the defaults.

Testing for Tree Clusters

There are some tree polygons that clearly represent a single tree, but there are also large polygons that represent a cluster of trees. In this example, we want to try to create one point per tree. The individual tree polygons are good to go, but the large polygons need further processing. We will attempt to separate these by area. Connect an AreaCalculator to the “Outside” port from the Clipper and leave the parameters set as the defaults.

After viewing the polygons over an orthophoto and looking at the results of the AreaCalculator, we decided that trees that had an area of 100 units or lower did not need further processing, while larger polygons did. Connect a Tester to the AreaCalculator outputs and set the Test Clause so that _area is less than 100.

Split Large Treed Areas

To split the large tree polygons uniformly, we used the Chopper transformer. Connect this transformer to the “Failed” output port from the Tester and set the parameters Mode to “By Length” and Approximate Length to 15 which represents the approximate height and width of the newly chopped areas. |

Finalize

Add a CenterPointReplacer transformer. Connect the “Passed” tree polygons from the Tester to the input port. Also connect the “Chopped” and “Untouched” output ports to the CenterPointReplacer input port. This transformer will replace the polygons with a point to represent the trees.

The points can now be written using an Esri Shapefile writer with default parameters. There is an orthophoto of this area in the .zip file provided if you would like to use for comparison. You may also view the results over a background map by going to Tool in the menu bar and clicking FME Options. In the new window under Background Map, you can set the Background Format to “Stamen Maps” and choose a map type in the parameters. Other Background Formats may be used with proper authentication.

The image below shows some of the points that were generated using the above workflow. Like with the building example, many of the output points are quite good, however, inaccuracies should be expected and further iterative or manual processing may be required.

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.

I have been trying this out and it works great, but I was speculating if there is some other approach to doing this that brings more accurate border. I of course just tried to increase the number of points included and reduced the buffer size but I still get an area that is kind of "fuzzy" when it comes to delimitation.

Hi @hlynur. Apologies for the delayed response. The above method is designed for FME 2011. If using FME 2012+, please use the HullReplacer transformer to replace the geometry of the feature with a polygon representing its hull. For a concave hull, it may be necessary to play around with the value set for the Alpha Value parameter. Please let me know if you have further questions. Kind regards,Natalie

Hi! This was a nice article that gave me some new ideas!
However, when it comes to creating the tree points, I would like to know if it would be possible to - instead of using CentrePointReplacer - use the point cloud data within the "tree areas" to find the position with the highest z-value - that should be a tree top! This would make the tree points appear closer to the real positions, I think?
Any suggestions to how to extract the positions with the highest z-values?