Loading [MathJax]/extensions/tex2jax.js
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[0].getAttributes()
19 idx_stat = inf.statistic[0].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()))