Python script opalsQuality
See Also
python.opalsQuality

Aim of module

proxy class for packages.python.opalsQuality

General description

Parameters
subScriptsremark : optional list of sub-scripts to be executed separated by commas
skipIfExistsremark : optional skip processing if result already exists skip processing if result already exists In order to re-run current script it is useful to repeat the processing only if the respective output does not already exist. This allows for incremental processing of large projects.
projectDirremark : optional project directory project directory All of the parameters mentioned above, if not specified as absolute paths, are relative to the project directory. The default project directory is the current working directory, but this can be changed easily using the -p parameter.
tempremark : optional temporary directory directory for temporary files Specifies the directory where all intermediate results are stored. If not specified, a TEMP subdirectory is created in the current working directory. Additional subdirectories (one per involved module) are created.
qgisProjectremark : optional path to qgis project file, if one should be written. A QGIS installation is required.
cfgremark : optional configuration file configuration file The name of a configuration file containing all relevant calculation parameters is expected. If not specified, the default cfg files as provided by the OPALS distribution are used.
gearmanremark : optional address and port of gearman job server currently this option is not yet supported. placed here for future reference
maskremark : optional create grid masks (sigma0, eccentricity)
gridMaskremark : optional raster file containing user-defined mask areas (e.g. water)
outfileremark : optional output directory or settings file (.txt) output directory Specifies the directory where the final results are stored. If not specified, the results are created in the current working directory.
infileremark : mandatory input text file, directory or strip file input files or file list As input either the name of an ASCII file (extension .txt) containing the names of the data files (one file per line) or an expression using wildcards to specify the respective data sets are accepted.
mosaicremark : optional create mosaics
See Also
Python script opalsQuality

The Python script opalsQuality is the main script for the corresponding opalsQuality package. It uses multiple sub-scripts to create different products for checking and documenting the quality of an ALS flight campaign. The following aspects are covered:

  • Data import: This is a pre-requisite for all other steps. ALS point cloud data files are read into the ODM (one ODM per flight strip, script: python._import).
  • Strip outline: Based on the ODMs, strip outlines (minimum bounding rectangle, convex hull, or alpha shape) are derived (script: python._bounds).
  • Overlapping pairs: Based on the strip outlines the overlapping strip pairs are identified (script: python._overlap).
  • Point density: Raster based analysis is performed based on the ODM and point density maps are created for each strip and for the overall project area (Python script qltDensity)
  • DSM and visualizations: For each strip a digital surface model (DSM) is calculated and a color coded hypsometric map as well as a shaded relief map are derived (Python script qltDSM).
  • Strip differences: Based on the DSMs and the list of overlapping strip pairs, difference models and color coded raster maps of the relative strip differences are derived. This is a basic product for assessing the quality of the flight strips orientation via visual inspection (Python script qltStripDiff).
  • strip difference vectors: A more quantitative analysis is carried out for all overlapping strip pairs, by estimating a best fitting 3D-affine-transformation via an Least Squares Matching approach (Python script qltLSM).

The following table contains a list of all involved sub-scripts and their default storage location:

opalsQuality
OPALS Module Default Directory Comments
Module Import .\import ODM files
Module Bounds .\bounds boundary files, only if no pairs specified
Module Overlap .\overlap list of overlapping pairs, only if no pairs specified
Module Grid .\grid strip-wise DSMs, additional features: sigma and excenter
Module Algebra .\grid grid mask (for strip differences and LSM)
Module Algebra .\grid

DSM mosaic

Module Cell .\cell point density models (strips)
Module Algebra .\cell

density mosaic

Module Algebra .\grid masked grid files
Module Diff .\diff for masked and unmasked files
Module Algebra .\diff

strip diff mosaic (masked and unmasked)

Module ZColor \opalsQuality color coded hypsometric maps
Module Shade \opalsQuality shaded relief maps
Module ZColor \opalsQuality color coded point density maps
Module ZColor \opalsQuality color coded strip difference maps
Module LSM \opalsQuality

LSM parameter files

Parameter description

-mosaic create mosaics
Type : Boolean
Remark :Optional, default: Boolean(True)
Description:
Possible values:

1True
0False
trueTrue
falseFalse
yesTrue
noFalse
-mask create grid masks (sigma0, eccentricity)
Type : Boolean
Remark :Optional, default: Boolean(True)
Description:
Possible values:

1True
0False
trueTrue
falseFalse
yesTrue
noFalse
-gridMask raster file containing user-defined mask areas (e.g. water)
Type : PathArgument
Remark :Optional, default:
Description:
-qgisProject path to qgis project file, if one should be written. A QGIS installation is required.
Type : PathArgument
Remark :Optional
Description:
Common Package/Script Options
Settings concerning the general options for (package) scripts.

-infile input text file, directory or strip file
Type : String
Remark :Mandatory
Description: input files or file list

As input either the name of an ASCII file (extension .txt) containing

the names of the data files (one file per line) or an expression using

wildcards to specify the respective data sets are accepted.
-outfile output directory or settings file (.txt)
Type : String
Remark :Optional
Description: output directory

Specifies the directory where the final results are stored.

If not specified, the results are created in the current working directory.
-temp temporary directory
Type : String
Remark :Optional, default: '.'
Description: directory for temporary files

Specifies the directory where all intermediate results are stored.

If not specified, a TEMP subdirectory is created in the current working

directory. Additional subdirectories (one per involved module) are created.
-cfg configuration file
Type : String
Remark :Optional
Description: configuration file

The name of a configuration file containing all relevant calculation parameters

is expected. If not specified, the default cfg files as provided by the OPALS

distribution are used.
-projectDir project directory
Type : String
Remark :Optional
Description: project directory

All of the parameters mentioned above, if not specified as absolute paths, are

relative to the project directory. The default project directory is the current

working directory, but this can be changed easily using the -p parameter.
-skipIfExists skip processing if result already exists
Type : Boolean
Remark :Optional, default: Boolean(True)
Description: skip processing if result already exists

In order to re-run current script it is useful to repeat the processing only if the

respective output does not already exist. This allows for incremental processing

of large projects.
Possible values:

1True
0False
trueTrue
falseFalse
yesTrue
noFalse
-gearman address and port of gearman job server
Type :
Remark :Optional
Description: currently this option is not yet supported. placed here for future reference
-subScripts list of sub-scripts to be executed separated by commas
Type : String
Remark :Optional, default: 'qltDSM,qltDensity,qltStripDiff,qltLSM'
Description:

Examples

The data used in the following examples can be found in the $OPALS_ROOT/demo/ directory.

Example 1

In the first example, only the strip data file list is specified as input parameter:

opalsQuality -i striplist.txt

striplist.txt may, e.g., contain the following lines:

strip11.laz
strip12.laz
strip21.laz
strip22.laz
#strip31.laz
#strip32.laz

Please note, that in the above example, strip31 and strip32 are ignored, since the corresponding line starts with a hash (=comment) character. Thus, the quality assessment is only carried out for the rest of the strips (strip11, strip21, strip21 and strip 22). Since no further parameters are specified, the output files are created in the current working directory ($OPALS_ROOT/demo/), all intermediate files are stored in subfolders of $OPALS_ROOT/demo/ and the default configuration files stored in $OPALS_ROOT/packages/cfg are used.

Example 2

To use all strip*.laz files and store the resulting and temporary files each in a separate folders, type:

opalsQuality -i strip*.laz -o resultsQuality -t tempdir

Example 3

For examples 1 and 2 to work, it is neccessary that the current working directory is $OPALS_ROOT/demo/. To achieve the same results from any current working directory, using the -p parameter, pointing to the directory containing the strip files, is recommended.

opalsQuality -i strip*.laz -o resultsQuality -t tempdir -p C:\OPALS\demo

Example 4

If only the strip differences should be calculated (disregarding already calculated intermediate outputs) for the overlapping strip pairs but not for the entire block, use the follwoing command:

opalsQuality -i strip*.laz -s qltStripDiff --mosaic 0 --skipIfExists 0

Please note, that the long parameter names starting woth two hyphens (–mosaic, –skipifExits) are used in this command. The very same command can also be written as:

opalsQuality -i strip*.laz -s qltStripDiff --mosaic 0 --skipIfExists 0
opalsQuality -i strip*.las -s qltStripDiff -m 0 -x 0