Frequently used command sequences (use case)

Table of Contents

This page contains a collection of useful OPALS command sequences. If you want your own cases published here, please send us an e-mail with the commands, a short description of the processing chain and optionally illustrative figures.


How to import point cloud data in the OPALS datamanager (ODM)?

To import point cloud data in the OPALS Data Manager (ODM), use the opalsImport module.

opalsImport -inFile strip11.laz -outFile strip11.odm

How to import multiple input files into a single ODM?

To import all files of a directory into a single ODM, use wildcard characters (*,?) during import (first case), while if only specific files need to be selected, use the quotes (second case).

opalsImport -inFile strip*.laz -outFile allStrips.odm
opalsImport -inFile "strip11.laz" "strip21.laz" "strip31.laz" -outFile halfStrips.odm

How to compute and store information about the laser beam?

To compute and store the laser beam information, import the point cloud into an ODM by providing the trajectory file as well and use the storeBeamInfo parameter.

opalsImport -inFile strip11.laz -trjFile TrjStrips_utm33.txt -tFormat trajectory.xml -storeBeamInfo BeamVector BeamVectorSCS Range ScanAngle

How to derive a shaded relief map based on a LiDAR point cloud?

To derive a hill shading, first import the point cloud into an ODM, interpolate an elevation grid model and then compute the shaded relief raster map.

opalsImport -inFile fullwave.fwf -outFile fwf.odm
opalsGrid -inFile fwf.odm -outFile dsm.tif -interpolation movingPlanes -gridSize 0.5 -searchRadius 3
opalsShade -inFile dsm.tif -sun 350 50

How to derive a colour coded elevation map?

To derive a colour coded elevation map, import the point cloud into an ODM, interpolate an elevation grid model and then perform Module ZColor a "z-coloring".

opalsImport -inFile fullwave.fwf -outFile fwf.odm
opalsGrid -inFile fwf.odm -outFile dsm.tif -interpolation movingPlanes -gridSize 0.5 -searchRadius 3
opalsZColor -inFile dsm.tif -zRange 278 322

How to analyse the height distribution of a data set?

To analyse the height distribution of a point cloud, import the data and compute a histogram of its z attribute (default).

opalsImport -inFile fullwave.fwf -outFile fwf.odm
opalsHisto -inFile fwf.odm -sampleRange 280 320 -binwidth 2

How to derive a histogram of a point attribute?

To derive a histogram of a point attribute, import the point cloud into an ODM and compute the histogram of the desired attribute (e.g. the Amplitude of each point).

opalsImport -inFile fullwave.fwf -outFile fwf.odm
opalsHisto -inFile fwf.odm -Attribute Amplitude

How to analyse and visualize the point density of a data set?

To analyse the point density of the data set, import the point cloud into an ODM, derive a point density raster model and compute its histogram. To visualize it as map, apply a z-coloring to it.

opalsImport -inFile fullwave2.fwf -outFile fwf2.odm
opalsCell -inFile fwf2.odm -outFile pdens.tif -cel 2.0 -feature pdens
opalsHisto -inFile pdens.tif
opalsZColor -inFile pdens.tif

How to compute and visualize height differences of overlapping strips?

To compute the height differences of overlapping strips, import both strips (points clouds), interpolate an elevation grid model (DEM) for each one and calculate a difference model of both DEMs. To visualize it, apply a z-coloring to it.

opalsImport -inFile strip12.laz
opalsImport -inFile strip22.laz
opalsGrid -inFile strip12.odm -outFile strip12_dsm.tif -gridSize 0.1 -interpolation movingPlanes -neighbours 8 -searchRadius 4
opalsGrid -inFile strip22.odm -outFile strip22_dsm.tif -gridSize 0.1 -interpolation movingPlanes -neighbours 8 -searchRadius 4
opalsAlgebra -inFile strip12_dsm.tif strip22_dsm.tif -formula r[0]-r[1] -outFile diff.tif
opalsZColor -inFile diff.tif

How to calculate a DEM based on last echoes only?

To calculate a DEM based on last echoes only, import the point cloud into an ODM and interpolate an elevation grid model by taking into account only the last echoes using a filter.

opalsImport -inFile fullwave.fwf -outFile fwf.odm
opalsGrid -inFile fwf.odm -outFile dsm_lastEchoes.tif -interpolation movingPlanes -gridSize 0.5 -searchRadius 3 -filter Echo[Last]

How to calculate a DTM based on ground points only?

To calculate a DTM based on ground points only, import the point cloud into an ODM and then interpolate an elevation grid model by taking into account only the ground points using a filter.

opalsImport -inFile strip11.laz -outFile strip11.odm
opalsGrid -inFile strip11.odm -outFile strip11.tif -interpolation movingPlanes -gridSize 0.5 -searchRadius 2 -filter Class[Ground]

How to perform quality control of an entire flight block?

To perform quality control of an entire flight block (point density, DEM, strip differences, strip displacements via LSM, including mosaic calculation), use the Python script opalsQuality.

opals Quality -i strip??.laz --mosaic 1 --skipIfExists 0

How to get a quick overview of a LiDAR dataset?

To get a quick overview of a LiDAR dataset, import the point cloud, derive a simple DEM, and visualize it as a shaded relief and a coloured map.

opalsImport -inFile fullwave.fwf
opalsGrid -inFile fullwave.odm -outFile dem.tif
opalsShade -inFile dem.tif
opalsZColor -inFile dem.tif

How to quickly check the available attributes of a LiDAR dataset?

To query the available attributes of of a LiDAR dataset, import the point cloud into an ODM and log the ODM header.

opalsImport -inFile strip11.laz
opalsInfo -inFile strip11.odm

How to compute normal vectors for each point in a point cloud?

To compute normal vectors for each point in a point cloud, import the point cloud into an ODM and estimate local surface normal information for each point.

opalsImport -inFile strip11.laz
opalsNormals -inFile strip11.odm -normalsAlg simplePlane -neighbours 8 -searchRadius 5 -filter Echo[Last]

How to calibrate a full waveform LiDAR data radiometrically?

To calibrate a full waveform LiDAR data radiometrically, import the point cloud into an ODM and estimate the normal vector for each point. Then, calculate the calibration constant and derive the calibrated radiometric values for each echo.

opalsImport -inFile strip11.laz -trjFile TrjStrips_utm33.txt -storeBeamInfo BeamVector Range -iFormat LAS_1.2_ew.xml -tFormat trajectory.xml
opalsNormals -inFile strip11.odm -normalsAlg simplePlane -neighbours 8 -searchRadius 5 -filter Echo[Last]
opalsRadioCal -inFile strip11.odm -outFile strip11_calRegion.odm -calRegionFile calRegion.wnp -reflectivityFile refl_1064.txt
opalsRadioCal -inFile strip11.odm -radioCal 3.33

How to flag outliers in a point cloud?

To flag outliers in a point cloud, import the point cloud into an ODM and update the Classification (attribute) values according to the desired criterion (e.g. 3D point density).

opalsImport -inFile strip149.las
opalsAddInfo -inFile strip149.odm -searchRadius 3 -searchMode d3 -neighbours 5 -attribute "Classification = count(n) <= 3 ? 64 : Classification"

How to derive a gap-free DEM?

To derive a gap-free DEM, import the point cloud into an ODM, interpolate DEMs with three different interpolation methods (movingPlanes, movingAverage and nearestNeighbour) and then fill in the gaps by combining these grid models.

opalsImport -inFile G111.las
opalsGrid -inFile G111.odm -outFile DEM_mp.tif -gridSize 0.1 -interpolation movingPlanes -searchRadius 4
opalsGrid -inFile G111.odm -outFile DEM_ma.tif -gridSize 0.1 -interpolation movingAverage -searchRadius 4
opalsGrid -inFile G111.odm -outFile DEM_nn.tif -gridSize 0.1 -interpolation nearestNeighbour -searchRadius 6
opalsAlgebra -inFile DEM_mp.tif DEM_ma.tif DEM_ma.tif -outFile DEM_gapfree.tif -formula "r[0] ? r[0] : r[1] ? r[1] : r[2]"

How to import/export points within a radius r from a given location (x1,y1)?

To import points within a radius r from a given location (x1,y1), import the point cloud into an ODM using a generic filter. For export, use the same principle.

opalsImport -inFile fullwave.fwf -outFile circle.odm -filter "Generic[sqrt(pow(x-24900.0,2)+pow(y-311210.0,2))<40]"
opalsExport -inFile circle.odm -outFile circle.las -filter "Generic[sqrt(pow(x-24900.0,2)+pow(y-311210.0,2))<40]"

How to import data in specified rectangular area of interest?

To import a dataset in a specified rectangular area of interest, import the point cloud into an ODM using a Region filter.

opalsImport -inFile fullwave.fwf -filter "Region [24850 311180 24950 311250]"

How to create a result only in a specified rectangular area of interest?

To create a result (e.g. a grid model) only in a specified rectangular area of interest, import the entire point cloud into an ODM and interpolate an elevation grid model using a user-defined grid limit.

opalsImport -inFile fullwave.fwf
opalsGrid -inFile fullwave.odm -outFile dsm.tif -interpolation movingPlanes -gridSize 0.5 -neighbours 5 -searchRadius 3 -limit "(24850 311180 24950 311250)"

How to find points on cables in point cloud data?

To find points on cables in point cloud data, import the point cloud into an ODM, estimate the normal vector for each point (using a high number of neighbours) and store the corresponding eigenvalues and eigenvectors. Then, add a new attribute _Linearity to the ODM and classify the points according to its values (Classification value 9: points with high linearity).

opalsImport -inFile railway.laz
opalsNormals -inFile railway.odm -normalsAlg simplePlane -neighbours 20 -searchRadius 1 -searchMode d3 -storeMetaInfo maximum
opalsAddInfo -inFile railway.odm -attribute "_Linearity=(NormalEigenvalue1-NormalEigenvalue2)/NormalEigenvalue1"
opalsAddInfo -inFile railway.odm -attribute "Classification = not _Linearity or _Linearity >= 0.8 && abs(_NormalEigenvector1Z)<= 0.1 ? 9 : Classification"
opalsExport -inFile railway.odm -outFile railway.las

How to store object heights (i.e. height above DEM) in an ODM?

To store object heights (i.e. height above DEM), import the point cloud into an ODM, interpolate an elevation grid model (DSM) and then add a new attribute NormalizedZ to the ODM, which describes the height difference between the point cloud and the DSM.

opalsImport -inFile strip11.laz
opalsGrid -inFile strip11.odm -outFile dsm.tif -gridSize 0.1 -interpolation movingPlanes -neighbours 8 -searchRadius 4
opalsAddInfo -inFile strip11.odm -gridFile dsm.tif -attribute NormalizedZ=z-r[0]

How to export X, Y, Z, Amplitude, EchoWidth from an ODM into a text file?

To export X, Y, Z, Amplitude, EchoWidth from an ODM into a text file, import the point cloud into an ODM including its input format and then export it including the desired output format.

opalsImport -inFile strip11.laz -iFormat LAS_1.2_ew.xml
opalsExport -inFile strip11.odm -outFile strip11.txt -oFormat Export_Ascii.xml

How to calculate a land cover dependent DSM from ALS data?

For calculating a land cover dependent DSM, import the point cloud into an ODM and then use the python script forDSM.

opalsImport -inFile strip11.laz
opals forDSM -i strip11.odm -g 0.1 -n 8 -r 4 --threshold 0.2

How to calculate a land cover dependent DSM from ALS data step-by-step?

The single processing steps of the above example are as follows. After data import and homogenization of the data distribution, two approximate DSMs are derived by rasterization (highest elevation within a cell) and movingPlanes interpolation. The final DSM is a combination of both models depending on the surface roughness (sigma0).

opalsImport -inFile strip11.laz
opalsCell -inFile strip11.odm -outFile pcl_max.odm -cellSize 0.5 -feature max
opalsGrid -inFile pcl_max.odm -outFile dsm_mp.tif sigma0.tif -interpolation movingPlanes -neighbours 8 -searchRadius 5 -feature sigma0
opalsCell -inFile pcl_max.odm -outFile dsm_max.tif -cellSize 1 -feature max
opalsAlgebra -inFile dsm_max.tif dsm_mp.tif sigma0.tif -outFile dsm_landcover.tif -formula "r[0] && r[2]>0.3 ? r[0] : r[1]"

How to consider all the points within a fixed neighbourhood size?

For all modules supporting both neighbours and searchRadius (e.g. opalsNormals, opalsGrid, opalsCell etc.), the primary search criterion is the nearest neighbous count. To enforce fixed distance queries, set the neighbour count significantly higher than the expected point density. For example:

opalsImport -inFile strip11.laz
opalsGrid -inFile strip11.odm -gridSize 0.5 -interpolation movingPlanes -neighbours 1000 -searchRadius 5

How to find tall vegetation (trees, bushes) in point cloud data?

To find tall vegetation (e.g. trees and bushes) in point cloud data, import the point cloud into an ODM and calculate the echo ratio for each point. Then, interpolate an echo ratio grid model, using only the first returns, and create a mask that maintains only the vegetation. Finally, smoothen the result by applying a morphological opening filter to it.

opalsImport -inFile railway.laz
opalsEchoRatio -inFile railway.odm -searchRadius 1 -ratioMode basic
opalsGrid -inFile railway.odm -outFile railway_er.tif -interpolation movingAverage -gridSize 0.5 -neighbours 16 -searchRadius 2 -attribute EchoRatio -filter echo[First]
opalsAlgebra -inFile railway_er.tif -outFile railway_er_mask.tif -formula "r[0] < 30 ? 1 : 0"
opalsMorph -inFile railway_er_mask.tif -outFile railway_er_mask_open_k1.tif -kernelSize 2 -kernelShape circle -operation open
Author
GM, Charis Chatzikyriakou
Date
01.07.2016