Creating Rasters and DEMs from Point Clouds in FME

Liz Sanderson
Liz Sanderson
  • Updated

FME Version

  • FME 2022.2

Introduction

Using FME, you can convert a point cloud to a raster and customize the raster image by adjusting factors like pixel resolution or which point cloud component to display.

Point cloud data offers non-uniform coverage via points, while a raster image displays complete coverage of an area using pixels. Converting a point cloud to a gridded raster results in easy-to-use data with a large amount of information.

The following exercises walk through how to convert a point cloud into a grayscale raster, as well as a digital elevation model (DEM).

To understand the basics of working with point clouds in FME, including the component values we will be working with below, see Getting Started with Point Clouds and Point Clouds (IFMEPointCloud) documentation

 

Step-by-Step Instructions

Part 1: Converting a Point Cloud to a Grayscale Raster

We will use the point cloud's intensity component to create a grayscale raster. This is done with the ImageRasterizer transformer. The intensity component tells us the reflectivity of an object, i.e. how "bright" it was during LiDAR data collection. For example, vegetation has high reflectivity and returns high intensity values, while pavement and rooftops have low reflectivity and return low intensity values. If we visualize a point cloud using intensity only, we can create a grayscale raster.

Download the attached data and workspace templates to get started.

1. Open FME Workbench
Open FME Workbench and start a new workspace, or open PointCloudToGrayscale.fmwt to follow along in the finished workspace.

2. Add a LAS reader
Add a new reader and set the following parameters:

  • Format: ASPRS Lidar Data Exchange Format (LAS)
  • Dataset: N2240690.las

Click OK.

LAS reader.png

If you inspect the input data, you will see a point cloud that looks like this:

cisN1n_Y1Ho2KQ_lTJ2E3Ceiz-U7YHRM-kZMe49kapEw0SpcTHKHIsESVNWDfRDTperI6HRPUbV5cvMAYAyGLV6QGQf-_e0c0pEXSpKYZked5Qx72NVS6I6Q7OTvwuAxr80KSHcQ

3. Add an ImageRasterizer transformer
Add an ImageRasterizer transformer, and connect it after the LAS reader. Open the parameters and set the following:
 

  • Resolution Specification: Cell Spacing
  • X Cell Spacing: 10
  • Y Cell Spacing: 10
  • Interpretation Type: Gray8
  • Background Color: 0,0,0 (black)
  • Anti-Aliasing: Yes
  • Input Component: Intensity

Click OK.

Screen Shot 2022-08-30 at 10.28.43 AM.png

This transformer will create a grayscale raster using the Intensity component.

4. Add a GeoTIFF writer

Add a new writer and set the following parameters:

  • Format: GeoTIFF (Geo-referenced Tagged Image File Format)
  • Dataset: [select an output folder]
  • Raster File Definition: Copy from Reader...

Click OK.

Screen Shot 2022-08-30 at 11.07.54 AM.png

Connect the writer feature type after the ImageRasterizer.
 

5. Run the workspace
Run the workspace and view the output. You should see a grayscale raster that looks like this:

LAS.jpg

6. Optional: Add transformers to smooth the raster
Note how there are some black points scattered across the raster. These are NoData spots, which is due to a lack of coverage because the distance between points is larger than rasterization spacing. We can fix this by using larger rasterization spacing in the ImageRasterizer (e.g. 20m instead of 10m). We can also smooth the raster by resampling up and then down using the RasterResampler.

Add the below transformers before the writer to smooth the raster, or open PointCloudToGrayscaleSmoothed.fmwt to see the finished workspace. These steps will reduce the contrast between the darker pixel values, which will also reduce the sharpness, so depending on your desired output, you may or may not find it helpful to do this.

(a) RasterCellValueReplacer. Set the parameters as in the below image. This will help remove some of the noise in the raster image by replacing 0 (black) with 127 (dark gray).

Screen Shot 2022-08-30 at 10.48.23 AM.png

(b) RasterResampler. Set the parameters as in the below image. This resamples the raster to 101%.

Screen Shot 2022-08-30 at 10.49.12 AM.png

(c) Add another RasterResampler. Set the parameters as in the below image. This resamples the raster to 99.001%.

Screen Shot 2022-08-30 at 10.49.35 AM.png
(d) Open the LAS writer feature type, and change “Compression Method” to “Pack Bits” and “Photometric Interpretation” to “MinIsBlack”.

Screen Shot 2022-11-09 at 11.00.06 AM.png

Run the workspace. The smoothed raster looks like this:

LAS-smoothed.jpg

Note how we have smoothed away the NoData spots.
 

Part 2: Converting a Point Cloud to a DEM Raster

We will use the point cloud's Z coordinate to create a DEM. This can be done automatically using the NumericRasterizer, SurfaceModeller, or RasterDEMGenerator. All of these will do the same task in different ways. For example, the SurfaceModeller can also generate contours or TINs, while the RasterDEMGenerator is able to interpolate holes, which gives a smoother output than the NumericRasterizer.
 

1. Open FME Workbench
Open FME Workbench and start a new workspace, or open PointCloudToDEM.fmwt to follow along in the finished workspace.

2. Add a LAS reader
Add a new reader and set the following parameters:

  • Format: ASPRS Lidar Data Exchange Format (LAS)
  • Dataset: 000736.las

Click OK.

Screen Shot 2022-11-09 at 11.44.52 AM.png


If you inspect the input data, you will see a point cloud that looks like this:

Screen Shot 2022-11-09 at 11.42.49 AM.png

3. Add a NumericRasterizer transformer
We will first try this using the NumericRasterizer. Note that we cannot smooth the raster as we did in part 1 because it will distort the surface, so to avoid NoData holes in the DEM coverage, we will set a large cell spacing of 10m. The cell spacing must be larger than any possible irregular gaps in the point coverage.

Add a NumericRasterizer transformer, and connect it after the LAS reader. Open the parameters and set the following:

  • Resolution Specification: Cell Spacing
  • X Cell Spacing: 10
  • Y Cell Spacing: 10
  • Anti-Aliasing > Tolerance: 1


Click OK.

Screen Shot 2022-11-09 at 11.48.05 AM.png
 

4. Add a RasterDEMGenerator transformer
We will also add a RasterDEMGenerator so we can compare the outputs.

After the LAS reader, add a RasterDEMGenerator, and set the following parameters:
 

  • Surface Tolerance: 0.0
  • Output DEM X Cell Spacing: 2
  • Output DEM Y Cell Spacing: 2

Screenshot 2022-11-10 at 11.42.52 AM.png

5. Add a GeoTIFF writer

Add a new writer and set the following parameters:

  • Format: GeoTIFF (Geo-referenced Tagged Image File Format)
  • Dataset: [select an output folder]
  • Raster File Definition: Copy from Reader...

Click OK.

Screen Shot 2022-08-30 at 11.07.54 AM.png

Connect the writer feature type after the NumericRasterizer. Then click Writers > Add Feature Type, and add a second writer feature type after the RasterDEMGenerator. The workspace should look like this:

Screenshot 2022-11-10 at 11.51.21 AM.png
 

6. Run the workspace
Run the workspace and view the output. You will have two DEM rasters. The images below show the raster produced by the NumericRasterizer, followed by the one produced by the RasterDEMGenerator. Note how the latter is smoother.
 

 numericrasterizer-output.jpg rasterdemgenerator-output.jpg

 

Data Attribution

The data from the first exercise 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 are supportive of the Ohio Enterprise.

The data from the second exercise originates from data made available by West Virginia View. They are sponsored by AmericaView and the USGS.

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.