23#include <QJsonDocument>
52 QStringList lst =
str.split(
'-' );
53 if ( lst.count() != 4 )
60 return QStringLiteral(
"%1-%2-%3-%4" ).arg( mD ).arg( mX ).arg( mY ).arg( mZ );
85 return id.d() +
id.x() +
id.y() +
id.z();
140 mXMin * scale.
x() + offset.
x(), mYMin * scale.
y() + offset.
y(),
141 mXMax * scale.
x() + offset.
x(), mYMax * scale.
y() + offset.
y()
147 return QgsDoubleRange( mZMin * scale.
z() + offset.
z(), mZMax * scale.
z() + offset.
z() );
176 QList<IndexedPointCloudNode> lst;
177 const int d = n.
d() + 1;
178 const int x = n.
x() * 2;
179 const int y = n.
y() * 2;
180 const int z = n.
z() * 2;
182 for (
int i = 0; i < 8; ++i )
184 int dx = i & 1, dy = !!( i & 2 ), dz = !!( i & 4 );
199 qint32 xMin = -999999999, yMin = -999999999,
zMin = -999999999;
200 qint32 xMax = 999999999, yMax = 999999999,
zMax = 999999999;
203 const double dLevel = ( double )d / pow( 2, n.
d() );
311 Q_UNUSED( attribute );
312 return QVariantList();
317 Q_UNUSED( attribute );
319 Q_UNUSED( statistic );
325 QMap<QString, QgsPointCloudAttributeStatistics> statsMap;
328 QString name = attribute.name();
334 if ( !min.isValid() )
339 s.
mean = mean.toDouble();
340 s.
stDev = stDev.toDouble();
343 for ( QVariant
c : classes )
347 statsMap[ name ] = s;
Represents a indexed point cloud node in octree.
static IndexedPointCloudNode fromString(const QString &str)
Creates node from string.
QString toString() const
Encode node to string.
IndexedPointCloudNode parentNode() const
Returns the parent of the node.
IndexedPointCloudNode()
Constructs invalid node.
QgsRange which stores a range of double values.
Collection of point cloud attributes.
const QgsPointCloudAttribute * find(const QString &attributeName, int &offset) const
Finds the attribute with the name.
Attribute for point cloud data pair of name and size in bytes.
Represents packaged data bounds.
qint32 xMax() const
Returns x max.
qint32 xMin() const
Returns x min.
qint32 yMax() const
Returns y max.
QgsDoubleRange zRange(const QgsVector3D &offset, const QgsVector3D &scale) const
Returns the z range, applying the specified offset and scale.
QgsPointCloudDataBounds()
Constructs invalid bounds.
qint32 zMax() const
Returns z max.
QgsRectangle mapExtent(const QgsVector3D &offset, const QgsVector3D &scale) const
Returns 2D rectangle in map coordinates.
qint32 yMin() const
Returns y min.
qint32 zMin() const
Returns z min.
Represents a indexed point clouds data in octree.
int span() const
Returns the number of points in one direction in a single node.
double zMax() const
Returns z max.
virtual qint64 nodePointCount(const IndexedPointCloudNode &n) const
Returns the number of points of a given node n.
QgsRectangle nodeMapExtent(const IndexedPointCloudNode &node) const
Returns the extent of a node in map coordinates.
virtual QVariant metadataClassStatistic(const QString &attribute, const QVariant &value, QgsStatisticalSummary::Statistic statistic) const
Returns the statistic statistic of the class value of the attribute attribute.
virtual QList< IndexedPointCloudNode > nodeChildren(const IndexedPointCloudNode &n) const
Returns all children of node.
QgsPointCloudIndex()
Constructs index.
QString subsetString() const
Returns the string used to define a subset of the point cloud.
double zMin() const
Returns z min.
QgsVector3D offset() const
Returns offset.
QgsVector3D scale() const
Returns scale.
virtual qint64 pointCount() const =0
Returns the number of points in the point cloud.
virtual QVariantList metadataClasses(const QString &attribute) const
Returns the classes of attribute.
void copyCommonProperties(QgsPointCloudIndex *destination) const
Copies common properties to the destination index.
virtual QVariant metadataStatistic(const QString &attribute, QgsStatisticalSummary::Statistic statistic) const
Returns the statistic statistic of attribute.
bool setSubsetString(const QString &subset)
Sets the string used to define a subset of the point cloud.
QHash< IndexedPointCloudNode, int > mHierarchy
Data hierarchy.
double mZMax
Vertical extent of data.
QgsPointCloudDataBounds mRootBounds
Bounds of the root node's cube (in int32 coordinates)
virtual QgsPointCloudStatistics metadataStatistics() const
Returns the object containings the statistics metadata extracted from the dataset.
QgsRectangle mExtent
2D extent of data
QgsPointCloudAttributeCollection mAttributes
QgsPointCloudDataBounds nodeBounds(const IndexedPointCloudNode &node) const
Returns bounds of particular node.
virtual bool hasNode(const IndexedPointCloudNode &n) const
Returns whether the octree contain given node.
QgsVector3D mOffset
Offset of our int32 coordinates compared to CRS coords.
QgsDoubleRange nodeZRange(const IndexedPointCloudNode &node) const
Returns the z range of a node.
float nodeError(const IndexedPointCloudNode &n) const
Returns node's error in map units (used to determine in whether the node has enough detail for the cu...
int mSpan
All native attributes stored in the file.
QgsVector3D mScale
Scale of our int32 coordinates compared to CRS coords.
QgsPointCloudExpression mFilterExpression
The filter expression to be evaluated when fetching node data.
void setAttributes(const QgsPointCloudAttributeCollection &attributes)
Sets native attributes of the data.
QgsPointCloudAttributeCollection attributes() const
Returns all attributes that are stored in the file.
Class used to store statistics of a point cloud dataset.
A rectangle specified with double values.
double yMaximum() const SIP_HOLDGIL
Returns the y maximum value (top side of rectangle).
double xMaximum() const SIP_HOLDGIL
Returns the x maximum value (right side of rectangle).
double xMinimum() const SIP_HOLDGIL
Returns the x minimum value (left side of rectangle).
double yMinimum() const SIP_HOLDGIL
Returns the y minimum value (bottom side of rectangle).
double width() const SIP_HOLDGIL
Returns the width of the rectangle.
Statistic
Enumeration of flags that specify statistics to be calculated.
@ StDev
Standard deviation of values.
double y() const
Returns Y coordinate.
double z() const
Returns Z coordinate.
double x() const
Returns X coordinate.
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into c
uint qHash(IndexedPointCloudNode id)
Hash function for indexed nodes.
Class used to store statistics of one attribute of a point cloud dataset.
QMap< int, int > classCount