Quick recipe

Adriaan van Natijne, October 2017.

Presented here is a abbriviated version of the manual presented in my Additional Thesis. Focus of this manual is to create a simple PoTree web-interface from a pointcloud and add radar measurements to it. This is not the full flowchart as discussed in the report. In this recipe a simple case of a single pointcloud and a small (less than 1500 points) radar file is discussed.



Using PoTreeConverter the input LAS-file is converted into an octree of binary files. For AHN3 tile 37EN1 the command will be as follows:

PotreeConverter C_37EN1.laz \
-o ./web --material INTENSITY -p AHN3 --show-skybox \
--projection "+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +units=m +no_defs" \
--edl-enabled --intensity-range 3 256 -r 256 \

Some explanation on the parameters:

  1. C_37EN1.laz, the input file or files.
  2. -o ./web, the output directory.
  3. --material INTENSITY, the attribute on display. All attributes mentioned under -a are stored, and may be selected for display in the viewer.
    Supported are: RGB, ELEVATION, INTENSITY, INTENSITY_GRADIENT, RETURN_NUMBER, SOURCE and LEVEL_OF_DETAIL. If the material is RGB, INTENSITY or CLASSIFICATION it should be mentioned under -a too!
  4. -p AHN3, the filename in the output directory (-o).
  5. --show-skybox, show some clouds as background (optional).
  6. --projection "...", projection (EPSG:28992), ignored by PoTreeConvert but used by PoTree for addding a map.
  7. --edl-enabled, enable %quot;Eye-Dome-Lighting%quot; for a more natural looking pointcloud.
  8. --intensity-range 3 256 -r 256, although a full intensity range up to 65536 is available, with AHN3 most points have an intensity value between 3 and 256. Without those limits the pointcloud will be all black.
  9. -a CLASSIFICATION INTENSITY, attributes to include in the output.

After running PoTreeConverter there should be a file web/AHN3.html. When opened in a browser (even locally) this should give a working PoTree installation.

Radar ellipsoids

Next step is adding the radar (error) ellipsoids. Independent of the source of the data JSON is the prefered format to feed the data to the viewer. In this recipe an extra simplified format is used. It may be extended at will.

As of Matlab 2016b jsonencode() is available. Other languages will have similar functions. The input does not matter as long as the output is of the same structure.

In this example the structure is a list of series of x, y, z values (as shown below) in the same coordinate system as the pointcloud. Whitespace is unimportant. The file should be saved as web/radar.json.


To add the ellipsoids, add the following lines to web/AHN3.html, before </script> at around line 72. The current parameters (scaling, rotation) are based on the TerraSAR-X estimates. See the comments for some guidance.

// Read the file
$.getJSON('./radar.json', function(data) {
    // Create a spehere with radius 1
    let sph = new THREE.SphereGeometry(1, 12, 10);

    // Create a material
    let sphm = new THREE.MeshNormalMaterial();

    // Create a rotation matrix
    var eul = new THREE.Euler(0, -1.150172, -1.605703);

    // Loop over all elements
    $.each(data, function(key, val) {
        // Create an element out of the sphere and the material
        let s = new THREE.Mesh(sph, sphm);

        // Scale the ellipsoid
        s.scale.set(0.075, 0.025, 5.00);

        // Rotate the ellipsoid

        // Position the ellipsoid
        s.position.set(val.x, val.y, val.z);

        // Calculate the transformation matrix ...
        s.matrixAutoUpdate = false; // ... only once, to improve performence

        // Add to the viewer (scene)

You should now see ellipsoids in your 3D world (hint: on the pavement, they are small)!

Index - Last edited: 2017-10-26 16:30 CEST