Module Info
See also
opals::IInfo

Aim of module

Extracts and reports header information of a vector or raster file (ODM, GDAL).

General description

opalsInfo extracts statistic information (number of points/lines/polygons, the bounding box, attribute information, spatial index details, etc..) from a data set input file. Currently, only ODMs are supported. However, the support of vector files, grid and tin file formats is planned for the future. In general, all information provided in the header of the file format is made available through a generic file statistics object.

See also
Module Info

Parameter description

-inFileinput file
Type: opals::Path
Remarks: mandatory
Currently ODMs, LAS/LAZ and grid can be specified as input file. More data formats may be supported in the future.
-exactComputationexact computation mode
Type: bool
Remarks: default=0
In exact mode the information is extracted/computed from the file content rather than from the file header. For certain formats (e.g. LAS/LAZ) more information can be presented, if the extact mode is activated.
-valueFrequencyextract value frequencies for defined attributes/bands
Type: opals::Vector<opals::String>
Remarks: optional
For the specified attribute/bands value frequencies will be extracted. This options implicitly activates the exact computation mode.
-statisticfile statistics
Type: opals::DataSetStats
Remarks: output
The result of the file statistic extraction provided as generic object. Specify -outParamFile in order to store these results to an XML file.
-exportOverviewexport header features
Type: opals::Vector<opals::HeaderFeature>
Remarks: optional
Possible values:  
  all .............. all possible header feature
  overviewZ ........ Z-Matrix overview
  overviewPcount ... Pcount-Matrix overview
Exports internally stored header information to files. This parameter is currently supported with ODMs file only.
-multiBandExport overview as multi-band raster
Type: bool
Remarks: default=0
When activated and exporting mulitple header feature a single overview file with multiple bands will be created.

Examples

The data used in the following example are located in the $OPALS_ROOT/demo/ directory. The example shows how to use opalsInfo to get an overview about data (including their attributes) within an odm.

Example 1:

As a prerequisite, the ALS point cloud data must be imported into the ODM. To achieve that, change to the demo directory and type:

opalsImport -inFile fullwave.fwf

Now, run the following command

opalsInfo -inFile fullwave.odm

which gives the following output:

[...]
14:24:23:
Data set statistic
Statistic Value
Filename D:\opals\demo\fullwave.odm
Type odm
Point Count 67413
Line Count 0
Polygon Count 0
Point density 3.75
SpatialReference
---
Bounding box
X Y Z
Minimum 24820.000 311160.006 275.535
Maximum 25000.000 311260.000 328.500
[...]

After a generic information block the section about the data set attributes is listed. Figure 1 captures the corresponding section from the log file.

Fig. 1: Attribute statistics of demo data set fullwave.fwf

A special feature of the ODM is the on-the-fly collection of statistical information of all attributes. A useful feature for checking the correctness of imported or processed data. The last five attributes (Id, FileId, LayerId, WinputCode and StructNr) are "virtual" attributes. They exist for internally reason, however, are not made persistent on disk.

With the following command

opalsNormals -infile fullwave.odm -neighbours 8 -searchRadius 1

local planes are estimated within each point of the data set. In the current example the computation succeeds for 67297 points (and fails in 116 cases). Running opalsInfo again

opalsInfo -inFile fullwave.odm

will show the newly added attributes (c.f. Figure 2). The statistics also reflect the number of successful computated plane estimations (For NormalSigma0 even less values have been set, since redundancy is required for its computation).

Fig. 2: Attribute statistics after normals estimation

The last section of the module output covers information of the spatial index (c.f. Figure 3). The spatial index statistics is also reported after importing a data set, since it is crucial for processing the ODM. For further details please refer to section Analysing the index statistics of an ODM.

Fig. 3: Spatial index information

Example 2:

When running Module Info within a Python script, direct access to the statistics of the dataset is provided via the OPALS Python API. This is exemplified in the sample script $OPALS_ROOT/demo/infoDemo.py:

1 import opals
2 from opals import Import
3 from opals import Info
4 #
5 # Set screen log level
6 #
7 logLevel=opals.Types.LogLevel.none
8 #
9 # Import strip11.laz dataset into an ODM
10 #
11 imp = Import.Import(inFile=["strip11.laz"], tileSize=5, screenLogLevel=logLevel)
12 imp.run()
13 #
14 # Run opalsInfo and query statistic object
15 #
16 inf = Info.Info(inFile=imp.outFile, screenLogLevel=logLevel)
17 inf.run()
18 att_stat = inf.statistic.getAttributes()
19 idx_stat = inf.statistic.getIndices ()
20 #
21 # Print attribute statistics
22 #
23 print("Attribute statistics of file {}".format(imp.outFile) )
24 print("Name: Count/Min/Mean/Max")
25 for a in att_stat:
26  print( "Name {}: {:0d}/{:0.3f}/{:0.3f}/{:0.3f}".format( a.getName(), a.getCount(), \
27  a.getMin(), a.getMean(), a.getMax()))
28 print("-----------------------------------------------------------")
29 #
30 # Print spatial index statistics
31 #
32 print("Spatial index statistics of file {}".format(imp.outFile) )
33 for i in idx_stat:
34  print("{:0d} leaves".format( i.getCountLeaf()))
35  print("Tile size: {:0.1f}".format(i.getTileSize()))
36  print("Min #pts per leaf: {:0.1f}".format(i.getObjectsInLeafMin()))
37  print("Mean #pts per leaf: {:0.1f}".format(i.getObjectsInLeafMean()))
38  print("Max #pts per leaf: {:0.1f}".format(i.getObjectsInLeafMax()))

To run the script, type:

python infoDemo.py

The script imports the dataset strip11.laz and queries the attribute and spatial index statistics. This is achieved by accessing the statistic parameter provided by Module Info. The script uses the access function of the complex Python type opals::DataSetStats to query (and print) the respective values.

Attribute statistics of file strip11.odm
Name: Count/Min/Mean/Max
Name Amplitude: 378712/1.000/68.774
Name EchoNumber: 378712/1.000/1.100
Name NrOfEchos: 378712/1.000/1.201
Name ClassificationFlags: 378712/0.000/0.000
Name ScanDirection: 378712/0.000/0.000
Name EdgeOfFlightLine: 378712/0.000/0.000
Name Classification: 378712/0.000/0.917
Name ScanAngle: 378712/0.000/0.000
Name UserData: 378712/0.000/0.000
Name PointSourceId: 378712/11.000/11.000
Name GPSTime: 378712/37983.419/37986.177
Name _PulseWidth: 378712/1.700/4.837
Name Id: 378712/2147483648.000/4729435047628892.000
Name FileId: 378712/1.000/1.000
Name LayerId: 378712/0.000/0.000
Name WinputCode: 378712/30.000/30.000
Name StructNr: 378712/0.000/0.000
-----------------------------------------------------------
Spatial index statistics of file strip11.odm
2090 leaves
Tile size: 5.0
Min #pts per leaf: 1.0
Mean #pts per leaf: 181.2
Max #pts per leaf: 530.0

Example 3: Value frequencies

Beside the standard statistic measures like min, max, mean and standard deviation, the module also supports the determination of value frequencies of specified attributes. This is feature can be used e.g. to retrieve all classification values that exist within a dataset. The following command

opalsInfo -inFile strip11.laz -valueFreq Classification

outputs (after the standard attribute table) a value frequency table for the specified attributes:

...
PointSourceId uint16 378712 --- 11 11 11.000 0.000
GPSTime double 378712 --- 37983.419 37988.897 37986.177 1.120
_PulseWidth double 378712 --- 1.700 31.500 4.837 0.653
12:22:52:
Value Frequencies
Name Value Absolute Frequency Relative Frequency [%]
Classification --- 0 0.00
0 205137 54.17
2 173575 45.83

Nodata values (or attributes that are marked as invalid) are printed in the first row and therefore also visible within the table. The value frequency is not limited to integer attributes, but the computation is currently restricted to 1000 unique values. If more than 1000 values exists, the frequency histogram is not further extended.

Author
jo, gm
Date
23.10.2018
@ statistic
general statistic information about a given input file (opalsInfo)
@ uint16
16 bit unsigned integer
opalsNormals is the executable file of Module Normals
Definition: ModuleExecutables.hpp:148
@ Y
sessions.adjustment.leverArm group(opalsStripAdjust)
@ ClassificationFlags
See LAS spec.
opalsImport is the executable file of Module Import
Definition: ModuleExecutables.hpp:113
@ Z
sessions.adjustment.leverArm group(opalsStripAdjust)
@ ScanAngle
Scan angle as defined by LAS standard.
@ Count
number of elements
Definition: GridFeature.hpp:34
@ Amplitude
Linear scale value proportional to the receiving power.
opalsInfo is the executable file of Module Info
Definition: ModuleExecutables.hpp:118
This is the fake namespace of all opals Python scripts.
Definition: doc/temp_doxy/python/__init__.py:1
@ odm
OPALS Datamanager file.
@ X
sessions.adjustment.leverArm group(opalsStripAdjust)
@ EchoNumber
This is the k-th return/echo for a certain pulse, where for the first return: k==1 (see LAS spec....
@ NrOfEchos
The pulse which this point is based on generated this number of returns/echoes (see LAS spec....
@ Classification
See LAS spec.
@ box
box type (3D)