19#include "moc_qgspointcloudindex.cpp"
24#include <QJsonDocument>
54 QStringList lst =
str.split(
'-' );
55 if ( lst.count() != 4 )
62 return QStringLiteral(
"%1-%2-%3-%4" ).arg( mD ).arg( mX ).arg( mY ).arg( mZ );
87 return id.d() +
id.x() +
id.y() +
id.z();
100 , mFilterExpression( expression )
106 return mNode == other.mNode &&
107 mUri == other.mUri &&
108 mRequest == other.mRequest &&
109 mFilterExpression == other.mFilterExpression;
167 mXMin * scale.
x() + offset.
x(), mYMin * scale.
y() + offset.
y(),
168 mXMax * scale.
x() + offset.
x(), mYMax * scale.
y() + offset.
y()
174 return QgsDoubleRange( mZMin * scale.
z() + offset.
z(), mZMax * scale.
z() + offset.
z() );
205 QList<IndexedPointCloudNode> lst;
206 const int d = n.
d() + 1;
207 const int x = n.
x() * 2;
208 const int y = n.
y() * 2;
209 const int z = n.
z() * 2;
211 for (
int i = 0; i < 8; ++i )
213 int dx = i & 1, dy = !!( i & 2 ), dz = !!( i & 4 );
228 qint64 xMin, yMin,
zMin, xMax, yMax,
zMax;
231 const double dLevel = ( double )d / pow( 2, n.
d() );
331 Q_UNUSED( attribute );
332 return QVariantList();
337 Q_UNUSED( attribute );
339 Q_UNUSED( statistic );
345 QMap<QString, QgsPointCloudAttributeStatistics> statsMap;
348 QString name = attribute.name();
354 if ( !min.isValid() )
359 s.
mean = mean.toDouble();
360 s.
stDev = stDev.toDouble();
363 for ( QVariant
c : classes )
367 statsMap[ name ] = s;
394 return cached ? cached->
clone() :
nullptr;
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.
Statistic
Available generic statistics.
@ StDev
Standard deviation of values.
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.
QVector< QgsPointCloudAttribute > attributes() const
Returns all attributes.
Attribute for point cloud data pair of name and size in bytes.
Base class for storing raw data from point cloud nodes.
int pointCount() const
Returns number of points that are stored in the block.
int pointRecordSize() const
Returns the total size of each individual point record.
QgsPointCloudBlock * clone() const
Clones the QgsPointCloudBlock returning a new copy.
Container class for QgsPointCloudBlock cache keys.
IndexedPointCloudNode node() const
Returns the key's IndexedPointCloudNode.
QgsPointCloudExpression filterExpression() const
Returns the key's QgsPointCloudExpression.
QgsPointCloudRequest request() const
Returns the key's QgsPointCloudRequest.
QgsPointCloudCacheKey(const IndexedPointCloudNode &n, const QgsPointCloudRequest &request, const QgsPointCloudExpression &expression, const QString &uri)
Ctor.
bool operator==(const QgsPointCloudCacheKey &other) const
QString uri() const
Returns the key's uri.
Represents packaged data bounds.
qint64 xMin() const
Returns x min.
qint64 zMin() const
Returns z min.
qint64 yMax() const
Returns y max.
qint64 xMax() const
Returns x max.
QgsDoubleRange zRange(const QgsVector3D &offset, const QgsVector3D &scale) const
Returns the z range, applying the specified offset and scale.
QgsPointCloudDataBounds()
Constructs invalid bounds.
QgsRectangle mapExtent(const QgsVector3D &offset, const QgsVector3D &scale) const
Returns 2D rectangle in map coordinates.
qint64 zMax() const
Returns z max.
qint64 yMin() const
Returns y 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.
QgsPointCloudBlock * getNodeDataFromCache(const IndexedPointCloudNode &node, const QgsPointCloudRequest &request)
Fetches the requested node data from the cache for the specified node and request.
static void storeNodeDataToCacheStatic(QgsPointCloudBlock *data, const IndexedPointCloudNode &node, const QgsPointCloudRequest &request, const QgsPointCloudExpression &expression, const QString &uri)
Stores existing data to the cache for the specified node, request, expression and uri.
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 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.
void storeNodeDataToCache(QgsPointCloudBlock *data, const IndexedPointCloudNode &node, const QgsPointCloudRequest &request)
Stores existing data to the cache for the specified node and request.
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.
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 containing 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.
static QMutex sBlockCacheMutex
QgsDoubleRange nodeZRange(const IndexedPointCloudNode &node) const
Returns the z range of a node.
static QCache< QgsPointCloudCacheKey, QgsPointCloudBlock > sBlockCache
virtual QVariant metadataStatistic(const QString &attribute, Qgis::Statistic statistic) const
Returns the statistic statistic of attribute.
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.
virtual QVariant metadataClassStatistic(const QString &attribute, const QVariant &value, Qgis::Statistic statistic) const
Returns the statistic statistic of the class value of the attribute attribute.
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.
Point cloud data request.
Class used to store statistics of a point cloud dataset.
A rectangle specified with double values.
double xMinimum() const
Returns the x minimum value (left side of rectangle).
double yMinimum() const
Returns the y minimum value (bottom side of rectangle).
double width() const
Returns the width of the rectangle.
double xMaximum() const
Returns the x maximum value (right side of rectangle).
double yMaximum() const
Returns the y maximum value (top side of rectangle).
Class for storage of 3D vectors similar to QVector3D, with the difference that it uses double precisi...
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
#define QgsDebugMsgLevel(str, level)
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