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. For computing BeamVectorSCS and ScanAngle it is necessary to specify a coordinate reference system using coord_ref_sys.

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



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_simple.shp
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?

Since OPALS version 2.3.0 Module FillGaps is provided for specifically solving this task. For completeness, however, a deprecated strategy for deriving a gap-free DEMs is also shown below. Therefore, 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_nn.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 -gridSize 0.1 -neig 8 -searchR 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



How to subsampling large or dense point clouds?

In general it is not recommended to subsample point clouds since it will result in loss of information. OPALS is designed to handle huge point cloud in an efficient way, so that subsampling point cloud is not required in general. However, for data sets with strongly varying point density selecting the optimal processing strategy and threshold can be challenging. In such situations and for exporting the data to other software products, subsampling can be beneficial or sometimes even necessary. OPALS currently provides three different ways of subsampling point clouds:

  1. randomly or sequentially picking the n-th point of the data set
  2. subsampling points based on 2D cells using Module Cell
  3. 3D subsampling based on a 3d search distance using Module AddInfo

Subsampling Method 1: Picking the n-th point

This simple and fast strategy can reduce the data amount by a certain factor but it cannot compensate for inhomogeneous point density. Using random and serial number generators in filters, every n-th point can be selected. Whereas serial number generator strictly picks every n-th from the input sequence, random number generator can be applied to select every n-th point in a stochastic way which can be beneficial in certain situations. In the following example every 10-th point is selected:

opalsImport -inFile strip11.laz -outf strip11_sub1_rand.odm -filter "generic[random(uniform_int, 1, 10) == 1]"
opalsImport -inFile strip11.laz -outf strip11_sub1_serial.odm -filter "generic[fmod(serial(), 10) == 0]"

Subsampling Method 2: Subsampling based on 2D cells

Module Cell is a flexible and powerful tool for subsampling based on 2D cells. Within each cell e.g. the echo with the highest amplitude, the point closest to the center, the lowest points, etc. can be selected and stored within an ODM. The only drawback of this strategy is that the subsampling is done based on 2D cells (it is planned to extend it to 3D cells in future releases). So in complex 3D scenes results might be unsatisfactory, because vertical structures will be underrepresented in the final point cloud. In the following example the closest point to each cell center is selected using a cell size of 1m, which will result in a very homogeneous point cloud.

opalsImport -inFile strip11.laz
opalsCell -inFile strip11.odm -outf strip11_sub2.odm -cellSize 1 -feature center

Subsampling Method 3: Selecting single points within 3D spheres

This method is currently the only option to subsample data based on 3D regions. The strategy selects a single point within 3D spheres with the help of an additional attribute (called _ignore in this case). If the attribute is set to 1 the point will be ignored and if it is 0 the point is marked for selection/subsampling. First, the attribute is initialised with 1 for all points during import (or use Module AddInfo if you do have an ODM file already). Then, the actual subsampling process is performed using Module AddInfo. If there is no neighbour marked for subsampling yet (number of neighbours is equal to the sum of the _ignore attribute of all neighbours), the current point is marked for subsampling (_ignore=0). Otherwise the attribute stays 1 (_ignore=1). Finally the points that are marked for subsampling are exported (_ignore==0) and the helper attribute is removed (remove[_ignore]). In the following example the neighbourhood is defined by a 3D search radius of 1m. The high number of neighbours (1000) secures that all points within the 1m sphere are considered. The resulting point cloud is homogeneous in 3D space but compared to method 2, one doesn't have control which specific point is selected for subsampling.

opalsImport -inf strip11.laz -filter "generic[_ignore(uint32)=1]"
opalsAddInfo -inf strip11.odm -neighb 1000 -searchr 1 -searchmod d3 -attr "_ignore=(count(n)==sum(n._ignore) ? 0 : 1)"
opalsExport -inf strip11.odm -outf strip11_sub3.odm -filter "generic[_ignore==0] and remove[_ignore]"
Author
GM, Charis Chatzikyriakou, JO
Date
28.05.2021
01.07.2016
opalsZColor is the executable file of Module ZColor
Definition: ModuleExecutables.hpp:253
@ NormalizedZ
point height above DTM
@ pdens
point density estimate
Definition: GridFeature.hpp:13
@ storeMetaInfo
level of meta info that are stored (opalsNormals)
@ BeamVectorSCS
Beam vector in the sensor coordinate system.
opalsNormals is the executable file of Module Normals
Definition: ModuleExecutables.hpp:148
@ gridFile
grid model file
@ nearestNeighbour
nearest neighbour interpolation
@ ratioMode
echo ratio calculation mode
@ movingPlanes
moving (tilted) plane interpolation
@ coord_ref_sys
default coordinate reference system (EPSG Code, WKT string or PRJ-File)
@ maximum
Storage of 'medium' infos, eigenvektor matrix.
opalsAddInfo is the executable file of Module AddInfo
Definition: ModuleExecutables.hpp:8
@ sigma0
sigma 0 of grid post adjustment (i.e. std.dev. of the unit weight observation)
Definition: GridFeature.hpp:12
@ trajectory
strip.trajectory group (opalsStripAdjust)
@ basic
basic echo ratio (# neighb. 3D / # neighb. 2D * 100)
@ tFormat
file format of the trajectory file (opalsImport)
opalsMorph is the executable file of Module Morph
Definition: ModuleExecutables.hpp:143
opalsAlgebra is the executable file of Module Algebra
Definition: ModuleExecutables.hpp:13
opalsImport is the executable file of Module Import
Definition: ModuleExecutables.hpp:113
@ movingAverage
moving average interpolation (=moving horizontal plane)
@ ScanAngle
Scan angle as defined by LAS standard.
@ strip
strip ID of an image (opalsStripAdjust)
@ zRange
range of z-values to be used for z-coloring (e.g. opalsZcolor)
@ threshold
threshold (opalsEdgeDetect)
opalsExport is the executable file of Module Export
Definition: ModuleExecutables.hpp:73
@ Amplitude
Linear scale value proportional to the receiving power.
opalsInfo is the executable file of Module Info
Definition: ModuleExecutables.hpp:118
Contains the public interface of OPALS.
Definition: AbsValueOrQuantile.hpp:8
@ kernelSize
output grid size equals entire kernel size
@ sampleRange
sample (attribute) range (e.g. opalsHisto)
@ BeamVector
Beam vector in the world coordinate system.
opalsGrid is the executable file of Module Grid
Definition: ModuleExecutables.hpp:93
opalsCell is the executable file of Module Cell
Definition: ModuleExecutables.hpp:23
@ Range
Measurment range.
opalsRadioCal is the executable file of Module RadioCal
Definition: ModuleExecutables.hpp:173
@ filter
string to be parsed in construction of DM::IFilter (various modules)
@ storeBeamInfo
defines beam information that is attached during import (opalsImport)
opalsHisto is the executable file of Module Histo
Definition: ModuleExecutables.hpp:103
@ simplePlane
performs a simple plane fit
@ searchMode
dimension of nearest neighbor search (opalsNormals)
@ feature
Use a statistic feature of the boundary gap points for filling.
@ circle
circular kernel (Euclidean metrics)
@ formula
formula string for albegraic grid computations (opalsAlgebra)
@ d3
Search based on full 3D coordinates (x,y and z)
opalsEchoRatio is the executable file of Module EchoRatio
Definition: ModuleExecutables.hpp:63
@ open
morphological opening filter
opalsShade is the executable file of Module Shade
Definition: ModuleExecutables.hpp:198
@ operation
coordinate operation for crs transformations (opalsTranslate)