Custom LIDAR data and Cesium

Cesium is a platform for 3D Geospatial data and software applications designed to unleash the power of 3D data. It is mainly the (open source) JavaScript library, 3D data publishing portal, and a private company, which is developing the whole platform.

The platform allows to display and interaction with 3D geospatial data, which can be buildings, terrain data, or point clouds (e.g. created with lidar).

MapTiler is providing global terrain 3D data tiles, which can be used along with the CesiumJS library to present the maps in the 3D context.

Custom LIDAR data data

They are usually stored in LAZ or LAS data formats in form of so-called point clouds. For your approach, we need the LAS format as input. The LAS file will later be converted to Cesium 3D tiles file structure.

LAZ to LAS

The LAS (LASer) format is a file format designed for the interchange and archiving of lidar point cloud data. It is an open, binary format specified by the American Society for Photogrammetry and Remote Sensing (ASPRS). The format is widely used and regarded as an industry standard for lidar data.

LAZ is just compressed (zipped) LAS file without information loss.

To convert between LAZ and LAS formats, we can you the PDAL library and tools. PDAL project is very similar to GDAL so the command used for data transformation should seem known.

$> pdal translate file.laz file.las

LAS can be rendered in QGIS using the Point Cloud data input.

cd2274a0-7d21-4476-a1f6-879ff673addd.png

And after setting it up, it can be also displayed in the 3D view.

b0ceda9e-8e48-4ffb-b75a-62426b77e455.png

LAS to Cesium 3D tiles format

Cesium 3D tiles is open specification, which can be used for storing 3D data of buildings, trees, point clouds, and vectors.

For converting the data into Cesium 3D tiles, there are various tools around. We made good experience with the gocesiumtiler project. The runtime requires Go language. To covert the LAS file to 3D tiles structure, you should run

$> mkdir 3dtiles  
$> gocesiumtiler -srid 3045 -input file.las -output 3dtiles
We had to specify EPSG code for the input data file (4326 is assumed by default). Resulting data will be stored in the 3dtiles directory.

Adding 3D data to Cesium web application

If you have already Cesium web application running, you can easy add 3DTileset:

// javascript  
  
import {Cesium3DTileset} from 'cesium';  
  
var lidar = new Cesium3DTileset({   
    url: "http://server/3dtiles3/tileset.json"   
});  
 
...  
  
viewer.scene.primitives.add(lidar);   
...

6aa88ba4-f1c3-4689-bf92-fc13f9115dc7.png

Example running at https://labs.maptiler.com/samples/cesium/custom-lidar

Conclusion

As result, we are now able to display a custom lidar dataset on the MapTiler quantized-mesh surface. The main task is, to convert the input LAS dataset into 3D tiled format specification. For this, an external tool gocesiumtlier can be used. 

Cesium Webpack example
Cesium 3D tiles generator
PDAL project
Quantized mesh specification
3D tiles specification