QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
pointcloud
qgspointcloudstatistics.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgspointcloudstatistics.h
3
--------------------
4
begin : May 2022
5
copyright : (C) 2022 by Belgacem Nedjima
6
email : belgacem dot nedjima at gmail dot com
7
***************************************************************************/
8
9
/***************************************************************************
10
* *
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
15
* *
16
***************************************************************************/
17
18
#ifndef QGSPOINTCLOUDSTATISTICS_H
19
#define QGSPOINTCLOUDSTATISTICS_H
20
21
#include "qgis_core.h"
22
23
#include <QSet>
24
#include <QVariant>
25
#include <QVector>
26
#include <QtMath>
27
28
class
QgsPointCloudAttribute
;
29
class
QgsPointCloudNodeId
;
30
31
#ifdef SIP_RUN
32
// clang-format off
33
% ModuleHeaderCode
34
#include "
qgspointcloudstatistics.h
"
35
% End
36
// clang-format on
37
#endif
38
47
struct
CORE_EXPORT
QgsPointCloudAttributeStatistics
48
{
49
double
minimum
= std::numeric_limits<double>::max();
50
double
maximum
= std::numeric_limits<double>::lowest();
51
double
mean
= 0;
52
double
stDev
= 0;
53
int
count
= 0;
54
#ifndef SIP_RUN
55
QMap<int, int>
classCount
;
57
void
cumulateStatistics
(
const
QgsPointCloudAttributeStatistics
&stats );
58
#endif
59
64
int
singleClassCount
(
int
cls )
const
;
65
};
66
75
class
CORE_EXPORT
QgsPointCloudStatistics
76
{
77
public
:
78
QgsPointCloudStatistics
();
79
80
#ifndef SIP_RUN
82
QgsPointCloudStatistics
(
int
sampledPointsCount
,
const
QMap<QString, QgsPointCloudAttributeStatistics> &stats );
83
#endif
84
86
int
sampledPointsCount
()
const
{
return
mSampledPointsCount; }
87
89
void
clear();
90
92
void
clear(
const
QVector<QgsPointCloudAttribute> &attributes );
93
95
QgsPointCloudAttributeStatistics
statisticsOf(
const
QString &attribute )
const
;
96
98
QList<int> classesOf(
const
QString &attribute )
const
;
99
100
#ifndef SIP_RUN
101
106
QMap<int, int> availableClasses(
const
QString &attribute )
const
;
107
#endif
108
113
double
minimum(
const
QString &attribute )
const
;
114
119
double
maximum(
const
QString &attribute )
const
;
120
125
double
mean(
const
QString &attribute )
const
;
126
131
double
stDev(
const
QString &attribute )
const
;
132
134
void
combineWith(
const
QgsPointCloudStatistics
&stats );
135
137
QByteArray toStatisticsJson()
const
;
138
140
static
QgsPointCloudStatistics
fromStatisticsJson(
const
QByteArray &stats );
141
142
#ifndef SIP_RUN
144
QMap<QString, QgsPointCloudAttributeStatistics>
statisticsMap
()
const
{
return
mStatisticsMap; };
145
#endif
146
private
:
147
int
mSampledPointsCount = 0;
148
QMap<QString, QgsPointCloudAttributeStatistics> mStatisticsMap;
149
151
static
QJsonObject attributeStatisticsToJson(
const
QgsPointCloudAttributeStatistics
&stats );
152
154
static
QgsPointCloudAttributeStatistics
fromAttributeStatisticsJson( QJsonObject &stats );
155
};
156
157
#endif
// QGSPOINTCLOUDSTATISTICS_H
QgsPointCloudAttribute
Attribute for point cloud data pair of name and size in bytes.
Definition
qgspointcloudattribute.h:43
QgsPointCloudNodeId
Represents an indexed point cloud node's position in octree.
Definition
qgspointcloudindex.h:56
QgsPointCloudStatistics
Used to store statistics of a point cloud dataset.
Definition
qgspointcloudstatistics.h:76
QgsPointCloudStatistics::QgsPointCloudStatistics
QgsPointCloudStatistics()
Definition
qgspointcloudstatistics.cpp:62
QgsPointCloudStatistics::sampledPointsCount
int sampledPointsCount() const
Returns the number of points used to calculate the statistics.
Definition
qgspointcloudstatistics.h:86
QgsPointCloudStatistics::statisticsMap
QMap< QString, QgsPointCloudAttributeStatistics > statisticsMap() const
Returns a map object containing all the statistics.
Definition
qgspointcloudstatistics.h:144
qgspointcloudstatistics.h
QgsPointCloudAttributeStatistics
Stores statistics of one attribute of a point cloud dataset.
Definition
qgspointcloudstatistics.h:48
QgsPointCloudAttributeStatistics::cumulateStatistics
void cumulateStatistics(const QgsPointCloudAttributeStatistics &stats)
Updates the current point cloud statistics to hold the cumulation of the current statistics and stats...
Definition
qgspointcloudstatistics.cpp:33
QgsPointCloudAttributeStatistics::singleClassCount
int singleClassCount(int cls) const
Returns the count of points in given class or -1 on error.
Definition
qgspointcloudstatistics.cpp:55
QgsPointCloudAttributeStatistics::stDev
double stDev
Definition
qgspointcloudstatistics.h:52
QgsPointCloudAttributeStatistics::classCount
QMap< int, int > classCount
Definition
qgspointcloudstatistics.h:55
QgsPointCloudAttributeStatistics::minimum
double minimum
Definition
qgspointcloudstatistics.h:49
QgsPointCloudAttributeStatistics::count
int count
Definition
qgspointcloudstatistics.h:53
QgsPointCloudAttributeStatistics::maximum
double maximum
Definition
qgspointcloudstatistics.h:50
QgsPointCloudAttributeStatistics::mean
double mean
Definition
qgspointcloudstatistics.h:51
Generated on
for QGIS API Documentation by
1.17.0