Skip to content

Point clouds

Ivan Pađen edited this page May 16, 2024 · 7 revisions

The requirements for point clouds are the following:

  • They must be in LAS/LAZ, TXT/XYZ, or PLY format
  • Buildings and terrain are classified and separated into different files. We advise on how to prepare the data below

Point clouds are typically stored in a LAS/LAZ format and you can use our point cloud preparation tool to extract the ground and building points. To examine the point cloud, we suggest you use CloudCompare, an open-source point cloud manipulation project and we offer information on preparing a point cloud with it. Alternatively, you can load LAZ/LAS files directly into QGIS.

Automatic preparation

The point cloud preparation tool can extract points in two ways, depending on whether the point cloud is already classified or not:

  • If the point cloud is classified, you can extract ground/water and building classes directly. According to the LAS standard, the ground and water classes are 2 and 9, respectively, whereas the building class is number 6.
  • If the point is not classified, the tool can apply the Cloth Simulation Filter (CSF) to separate ground and non-ground points. The success of the CSF depends on the topology of the region in question, so for the best results, we advise to have a properly classified point cloud. This is very important for LoD1.3 and LoD2.2 reconstruction.

The tool is compiled as a separate executable in the project. If you compiled the code yourself, you can find it in the following path: $build_folder/tools/point_cloud_preparation/city4cfd_pcprep. For other methods of installation, you can directly run the executable with the JSON configuration file as the input, e.g.

city4cfd_pcprep config.json

or, in the case of Docker

./city4cfd_docker.sh city4cfd_pcprep config.json

An example of the JSON configuration file can be found here. We will give a quick walkthrough of the options.

{
  "las_files":
  [
      "points_2.laz",
      "points_1.laz"
  ],
  "ground_classes": [2, 9],
  "building_classes": [6],
  "bbox": [22130, 441400, 23130, 44240],
  "thinning": 40
}

las_files: You can add multiple LAS/LAZ tiles and the tool will conduct merging. If you are using one file, do not forget to remove the comma after the filename. This is the only compulsory argument in the configuration file, the rest are optional.

ground_classes: We suggest using 2 and 9 in the case of a classified point cloud, which are ground and water points according to the LAS format specification.

building_classes: We suggest using 6 in the case of a classified point cloud, according to the LAS specification.

bbox: Exclude the unnecessary points by setting the bounding box in format [xmin, ymin, xmax, ymax].

thinning: Define what percentage of points are being radomly removed from the point cloud to remove overall memory strain.

If either ground_classes or building_classes arguments are missing, the tool will proceed with the CSF filter. Point clouds can be very dense, so using the bbox and thinning options is warmly recommended.

(back to top)

Manual preparation

Thinning

As we already mentioned, point clouds can get very dense, hence we need to remove some of the points for efficiency reasons. A rule of thumb is have a 1 terrain point per m^2, but this number can vary on a case-by-case basis. The number of building points depends on the targeted LoD. In case of LoD2.2 and LoD1.3, we suggest to use as many points as they fit in memory, whereas for LoD1.2 less points can be used. The process of removal of points is referred to as thinning. You should use random thinning for building points, while space-based thinning can result in uniform terrain triangulation, should isotropic terrain triangulation be your goal. In CloudCompare, you perform subsampling of the point cloud to extract thinned points. Access it through EditSubsample.

Please note that City4CFD also has random thinning implemented as part of the workflow. The intention of this is to speed up the reconstruction during the initial setup iterations.

Separating terrain and buildings

Point clouds are generally available in LAS/LAZ formats, which, by default, contain specific classes, with the two of them reserved for ground (class 2) and buildings (class 6). However, not every point cloud is nicely classified. You can check for classification in CloudCompare.

pointcloud

In case the ground and buildings are properly classified, you can use EditScalar FieldsFilter By Value with classification selected as an active scalar field in the property menu.

When buildings and ground are not properly classified, you can use the whole point cloud as input for buildings, whereas for the terrain you need to conduct terrain filtering. CloudCompare contains Cloth Simulation Filter (CSF) which handles filtering automatically. You can find it in PluginsCSF Filter.

Proposed workflow

We can propose the following workflow for preparing the point cloud:

  • Load the point cloud into CloudCompare
  • Subsample with random thinning in case of a large number of points (tens of millions)
  • If the point cloud is classified:
    • Extract buildings (class 6), extract terrain (class 2) with water points (class 9)
    • Conduct additional space-based thinning (e.g. 10 m) if you would like isotropic terrain mesh
    • Export buildings and terrain + water separately to different PLY or XYZ files
  • If the point cloud is not classified:
    • Perform terrain filtering with the CSF
    • Conduct additional space-based thinning on the ground points if you would like isotropic terrain mesh
    • Export the off-ground point cloud and use it as input for buildings, export the ground point cloud and use it for terrain

Please bear in mind that the program runtime greatly depends on the number of points that are used, especially with the terrain. Everything up to a few million (3-4) for terrain will be fairly quick. But still, a good rule of thumb is to use strong thinning in City4CFD (values of 80-90%) until your final reconstruction.

Importing point cloud into QGIS

QGIS natively supports LAS/LAZ format. You can import the point cloud into QGIS to make sure the polygon and point projections match. You can view the point cloud in 3D by selecting ViewNew 3D Map View. More information can be found here. If the original point cloud is too large, perform thinning before loading it into QGIS.

(back to top)