Pointcloud conversion guide

From Accelerated Operations Service

Language options:


Other languages:

​Instructions on how to convert and upload pointcloud files to Accelerated Operations Service​.

TLDR instructions

  1. Merge pointclouds to a single pointcloud, export it as a LAS format file.
  2. Use PotreeConverter to convert LAS file to Potree format.
  3. Zip the output files (NOT the directory) to an archive.
  4. Upload the archive to Accelerated Operations Service.

File formats

Accelerated Operations Service accepts zipped Potree format pointclouds. Potree is an open source tool to generate massive pointclouds that can be viewed on a web browser. Potree is based on multiple research projects and makes it possible to efficiently stream only the relevant parts of large clouds to end users. Potree format pointclouds are converted with PotreeConverter which uses a single LAS format file as input.

The 3D viewer in Accelerated Operations Service currently supports only a single pointcloud, so it requires a bit of work to merge the input clouds.

Preparing the LAS input file from E57 format

You need a single LAS input file to be later processed with PotreeConverter. E57 is a standard format that multiple pointcloud applications support. Unlike LAS, the E57 file format may contain multiple scans as invidual pointclouds that have to be merged to a single cloud. One way to do this is using CloudCompare to convert the scans to individual LAS files and then merge them to a single LAS file.

You may be able to do this operations on CloudCompare GUI too, but it's not very efficient since it renders the clouds at the same time. And it can not render large clouds. Hence the command line.

The simplest possible case is the following. The cloud is perhaps a few gigabytes and can be processed directly on memory. Output is a single LAS file where the scans have been merged into a single cloud.

  • cloudcompare -O input_cloud.e57 -C_EXPORT_FMT LAS -AUTO_SAVE OFF -MERGE_CLOUDS -SAVE_CLOUDS

Alternatively, if you want to subsample the cloud (decrease the number of points) at this stage, use the SS SPATIAL parameter. 0.01 = 1 centimeter, meaning that minimum distance between two points is one centimeter. Use the value that you see fit. This might significantly reduce the file size.

  • cloudcompare -O input_cloud.e57 -C_EXPORT_FMT LAS -AUTO_SAVE OFF -SS SPATIAL 0.01 -MERGE_CLOUDS -SAVE_CLOUDS

If you have multiple E57 files from the same area and you want to merge them in a single cloud, first convert each of the E57 files as described above, then merge them in one file.

  • cloudcompare -O cloud1.las -O cloud2.las -C_EXPORT_FMT LAS -AUTO_SAVE OFF -MERGE_CLOUDS -SAVE_CLOUDS

Converting LAS file to Potree format

  1. Merge and convert your pointclouds to a single LAS file as described above.
  2. Download PotreeConverter 2.1.1, and extract it: https://github.com/potree/PotreeConverter/releases/tag/2.1.1
  3. Open command prompt, go to the directory of the LAS file and run (or use the batch file):
    PotreeConverter.exe cloud.las --encoding BROTLI
    By using Brotli (the encoding parameter) you can significantly reduce the file size.
  4. Add octree.bin, hierarchy.bin and metadata.json to a zip file. Just the files, not the folder.​
  5. Go to AOS, enable 3D models from settings, go to 3D menu and click "Add pointcloud".
  6. Select the zip file to upload it.

Batch file

You can use the following batch (.bat) file to skip working with the command line (step 3 in the previous section). Name it e.g. PotreeConverter.bat and place it in the same folder where PotreeConverter.exe is located. Then just drag and drop the LAS file on top of the bat file in file explorer.

set source="%~1"
cd %~dp0
PotreeConverter.exe %source% --encoding BROTLI
pause

Troubleshooting

Scalar field errors

If you end up having an error on scalar fields data types (LAS 8 bit unsigned integers vs e57 doubles) use the REMOVE_ALL_SFS parameter to remove the scalar fields. You will lose most likely the intensity values:

  • cloudcompare -O input_cloud.e57 -C_EXPORT_FMT LAS -AUTO_SAVE OFF -REMOVE_ALL_SFS -MERGE_CLOUDS -SAVE_CLOUDS

LAS time

If PotreeConverter freezes or fails, try to load the model to CloudCompare without time field. Then save it again.

Issues with running out of memory

Things get interesting when you start to run out of memory with large clouds. You may need to do a multiple step merge on your files. This approach was working for us with 40 GB clouds. This example saves four clouds:

  • cloudcompare -O input_cloud_with_4_scans.e57 -C_EXPORT_FMT LAS -SAVE_CLOUDS

Then merge the two first clouds.

  • cloudcompare -O input_cloud1.las -O input_cloud2.las -C_EXPORT_FMT LAS -MERGE_CLOUDS -SAVE_CLOUDS FILE input_clouds_1-2.las

Then merge the two latter clouds

  • cloudcompare -O input_cloud3.las -O input_cloud4.las -C_EXPORT_FMT LAS -MERGE_CLOUDS -SAVE_CLOUDS FILE input_clouds_3-4.las

Then merge the two previous output clouds

  • cloudcompare -O input_clouds_1-2.las -O input_clouds_3-4.las -C_EXPORT_FMT LAS -MERGE_CLOUDS -SAVE_CLOUDS FILE clouds_1-4.las

Things get even more interesting if you're still running out of memory. You may fiddle more with CloudCompare subsampling option (-SS) to remove duplicate or close points. With a 100 GB cloud we had to export the cloud to a PTS file from Recap and the convert it to LAS with Pointzip.