QGIS API Documentation 3.41.0-Master (d2aaa9c6e02)
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
QgsAbstractPointCloudIndex Class Referenceabstract

Represents a indexed point clouds data in octree. More...

#include <qgspointcloudindex.h>

Inheritance diagram for QgsAbstractPointCloudIndex:
Inheritance graph
[legend]

Public Member Functions

 QgsAbstractPointCloudIndex ()
 Constructs index.
 
virtual ~QgsAbstractPointCloudIndex ()
 
virtual Qgis::PointCloudAccessType accessType () const =0
 Returns the access type of the data If the access type is Remote, data will be fetched from an HTTP server either synchronously or asynchronously If the access type is local, the data is stored locally as a file and will only be fetch synchronously ( blocking request with nodeData only )
 
virtual QgsPointCloudBlockRequestasyncNodeData (const QgsPointCloudNodeId &n, const QgsPointCloudRequest &request)=0
 Returns a handle responsible for loading a node data block.
 
QgsPointCloudAttributeCollection attributes () const
 Returns all attributes that are stored in the file.
 
virtual std::unique_ptr< QgsAbstractPointCloudIndexclone () const =0
 Returns a clone of the current point cloud index object.
 
void copyCommonProperties (QgsAbstractPointCloudIndex *destination) const
 Copies common properties to the destination index.
 
virtual QgsCoordinateReferenceSystem crs () const =0
 Returns the coordinate reference system of the point cloud index.
 
QString error () const
 Returns the error that occurred during the loading of the index.
 
QgsRectangle extent () const
 Returns extent of the data.
 
virtual QVariantMap extraMetadata () const
 Returns extra metadata that's not accessible through the other methods in an implementation-specific dynamic structure.
 
virtual QgsPointCloudNode getNode (const QgsPointCloudNodeId &id) const
 Returns object for a given node.
 
QgsPointCloudBlockgetNodeDataFromCache (const QgsPointCloudNodeId &node, const QgsPointCloudRequest &request)
 Fetches the requested node data from the cache for the specified node and request.
 
virtual bool hasNode (const QgsPointCloudNodeId &n) const
 Returns whether the octree contain given node.
 
virtual bool isValid () const =0
 Returns whether index is loaded and valid.
 
virtual void load (const QString &fileName)=0
 Loads the index from the file.
 
virtual QgsPointCloudStatistics metadataStatistics () const
 Returns the object containing the statistics metadata extracted from the dataset.
 
virtual std::unique_ptr< QgsPointCloudBlocknodeData (const QgsPointCloudNodeId &n, const QgsPointCloudRequest &request)=0
 Returns node data block.
 
QgsVector3D offset () const
 Returns offset of data from CRS.
 
virtual QVariantMap originalMetadata () const =0
 Returns the original metadata map.
 
virtual qint64 pointCount () const =0
 Returns the number of points in the point cloud.
 
QgsPointCloudNodeId root () const
 Returns root node of the index.
 
QgsBox3D rootNodeBounds () const
 Returns bounding box of root node in CRS coords.
 
QgsVector3D scale () const
 Returns scale of data relative to CRS.
 
bool setSubsetString (const QString &subset)
 Sets the string used to define a subset of the point cloud.
 
int span () const
 Returns the number of points in one direction in a single node.
 
void storeNodeDataToCache (QgsPointCloudBlock *data, const QgsPointCloudNodeId &node, const QgsPointCloudRequest &request) const
 Stores existing data to the cache for the specified node and request.
 
QString subsetString () const
 Returns the string used to define a subset of the point cloud.
 
virtual bool updateNodeData (const QHash< QgsPointCloudNodeId, QByteArray > &data)
 Tries to update the data for the specified nodes.
 
virtual bool writeStatistics (QgsPointCloudStatistics &stats)
 Writes the statistics object stats into the backing file, if possible.
 
double zMax () const
 Returns z max.
 
double zMin () const
 Returns z min.
 

Static Public Member Functions

static void storeNodeDataToCacheStatic (QgsPointCloudBlock *data, const QgsPointCloudNodeId &node, const QgsPointCloudRequest &request, const QgsPointCloudExpression &expression, const QString &uri)
 Stores existing data to the cache for the specified node, request, expression and uri.
 

Protected Member Functions

void setAttributes (const QgsPointCloudAttributeCollection &attributes)
 Sets native attributes of the data.
 

Protected Attributes

QgsPointCloudAttributeCollection mAttributes
 
QString mError
 
QgsRectangle mExtent
 2D extent of data
 
QgsPointCloudExpression mFilterExpression
 The filter expression to be evaluated when fetching node data.
 
QHash< QgsPointCloudNodeId, int > mHierarchy
 Data hierarchy.
 
QMutex mHierarchyMutex
 
QgsVector3D mOffset
 Offset of our int32 coordinates compared to CRS coords.
 
QgsBox3D mRootBounds
 Bounds of the root node's cube (in int32 coordinates)
 
QgsVector3D mScale
 Scale of our int32 coordinates compared to CRS coords.
 
int mSpan = 0
 All native attributes stored in the file.
 
QString mUri
 
double mZMax = 0
 Vertical extent of data.
 
double mZMin = 0
 

Static Protected Attributes

static QCache< QgsPointCloudCacheKey, QgsPointCloudBlocksBlockCache
 
static QMutex sBlockCacheMutex
 

Detailed Description

Represents a indexed point clouds data in octree.

Note
The API is considered EXPERIMENTAL and can be changed without a notice
Since
QGIS 3.42

Definition at line 214 of file qgspointcloudindex.h.

Constructor & Destructor Documentation

◆ QgsAbstractPointCloudIndex()

QgsAbstractPointCloudIndex::QgsAbstractPointCloudIndex ( )
explicitdefault

Constructs index.

◆ ~QgsAbstractPointCloudIndex()

QgsAbstractPointCloudIndex::~QgsAbstractPointCloudIndex ( )
virtualdefault

Member Function Documentation

◆ accessType()

virtual Qgis::PointCloudAccessType QgsAbstractPointCloudIndex::accessType ( ) const
pure virtual

Returns the access type of the data If the access type is Remote, data will be fetched from an HTTP server either synchronously or asynchronously If the access type is local, the data is stored locally as a file and will only be fetch synchronously ( blocking request with nodeData only )

Note
Always make sure to check before trying to use asyncNodeData since it is not supported in the case of local access type

Implemented in QgsPointCloudEditingIndex.

◆ asyncNodeData()

virtual QgsPointCloudBlockRequest * QgsAbstractPointCloudIndex::asyncNodeData ( const QgsPointCloudNodeId n,
const QgsPointCloudRequest request 
)
pure virtual

Returns a handle responsible for loading a node data block.

e.g. positions (needs to be scaled and offset applied to get coordinates) or classification, intensity or custom attributes

It is caller responsibility to free the handle and the block issued by the handle if the loading succeeds.

May return nullptr in case the node is not present or any other problem with loading

Implemented in QgsPointCloudEditingIndex.

◆ attributes()

QgsPointCloudAttributeCollection QgsAbstractPointCloudIndex::attributes ( ) const

Returns all attributes that are stored in the file.

Definition at line 204 of file qgspointcloudindex.cpp.

◆ clone()

virtual std::unique_ptr< QgsAbstractPointCloudIndex > QgsAbstractPointCloudIndex::clone ( ) const
pure virtual

Returns a clone of the current point cloud index object.

Note
It is the responsibility of the caller to handle the ownership and delete the object.
Since
QGIS 3.26

Implemented in QgsPointCloudEditingIndex.

◆ copyCommonProperties()

void QgsAbstractPointCloudIndex::copyCommonProperties ( QgsAbstractPointCloudIndex destination) const

Copies common properties to the destination index.

Since
QGIS 3.26

Definition at line 277 of file qgspointcloudindex.cpp.

◆ crs()

virtual QgsCoordinateReferenceSystem QgsAbstractPointCloudIndex::crs ( ) const
pure virtual

Returns the coordinate reference system of the point cloud index.

Implemented in QgsPointCloudEditingIndex.

◆ error()

QString QgsAbstractPointCloudIndex::error ( ) const
inline

Returns the error that occurred during the loading of the index.

Since
QGIS 3.26

Definition at line 238 of file qgspointcloudindex.h.

◆ extent()

QgsRectangle QgsAbstractPointCloudIndex::extent ( ) const
inline

Returns extent of the data.

Definition at line 312 of file qgspointcloudindex.h.

◆ extraMetadata()

QVariantMap QgsAbstractPointCloudIndex::extraMetadata ( ) const
virtual

Returns extra metadata that's not accessible through the other methods in an implementation-specific dynamic structure.

Since
QGIS 3.42

Definition at line 321 of file qgspointcloudindex.cpp.

◆ getNode()

QgsPointCloudNode QgsAbstractPointCloudIndex::getNode ( const QgsPointCloudNodeId id) const
virtual

Returns object for a given node.

Reimplemented in QgsPointCloudEditingIndex.

Definition at line 169 of file qgspointcloudindex.cpp.

◆ getNodeDataFromCache()

QgsPointCloudBlock * QgsAbstractPointCloudIndex::getNodeDataFromCache ( const QgsPointCloudNodeId node,
const QgsPointCloudRequest request 
)

Fetches the requested node data from the cache for the specified node and request.

If not found in the cache, nullptr is returned. Caller takes ownership of the returned object.

Definition at line 293 of file qgspointcloudindex.cpp.

◆ hasNode()

bool QgsAbstractPointCloudIndex::hasNode ( const QgsPointCloudNodeId n) const
virtual

Returns whether the octree contain given node.

Reimplemented in QgsPointCloudEditingIndex.

Definition at line 163 of file qgspointcloudindex.cpp.

◆ isValid()

virtual bool QgsAbstractPointCloudIndex::isValid ( ) const
pure virtual

Returns whether index is loaded and valid.

Implemented in QgsPointCloudEditingIndex.

◆ load()

virtual void QgsAbstractPointCloudIndex::load ( const QString &  fileName)
pure virtual

Loads the index from the file.

Implemented in QgsPointCloudEditingIndex.

◆ metadataStatistics()

QgsPointCloudStatistics QgsAbstractPointCloudIndex::metadataStatistics ( ) const
virtual

Returns the object containing the statistics metadata extracted from the dataset.

Since
QGIS 3.42

Definition at line 258 of file qgspointcloudindex.cpp.

◆ nodeData()

virtual std::unique_ptr< QgsPointCloudBlock > QgsAbstractPointCloudIndex::nodeData ( const QgsPointCloudNodeId n,
const QgsPointCloudRequest request 
)
pure virtual

Returns node data block.

e.g. positions (needs to be scaled and offset applied to get coordinates) or classification, intensity or custom attributes.

May return nullptr in case the node is not present or any other problem with loading

Implemented in QgsPointCloudEditingIndex.

◆ offset()

QgsVector3D QgsAbstractPointCloudIndex::offset ( ) const

Returns offset of data from CRS.

Definition at line 214 of file qgspointcloudindex.cpp.

◆ originalMetadata()

virtual QVariantMap QgsAbstractPointCloudIndex::originalMetadata ( ) const
pure virtual

Returns the original metadata map.

Implemented in QgsPointCloudEditingIndex.

◆ pointCount()

virtual qint64 QgsAbstractPointCloudIndex::pointCount ( ) const
pure virtual

Returns the number of points in the point cloud.

Implemented in QgsPointCloudEditingIndex.

◆ root()

QgsPointCloudNodeId QgsAbstractPointCloudIndex::root ( ) const
inline

Returns root node of the index.

Definition at line 269 of file qgspointcloudindex.h.

◆ rootNodeBounds()

QgsBox3D QgsAbstractPointCloudIndex::rootNodeBounds ( ) const
inline

Returns bounding box of root node in CRS coords.

Definition at line 320 of file qgspointcloudindex.h.

◆ scale()

QgsVector3D QgsAbstractPointCloudIndex::scale ( ) const

Returns scale of data relative to CRS.

Definition at line 209 of file qgspointcloudindex.cpp.

◆ setAttributes()

void QgsAbstractPointCloudIndex::setAttributes ( const QgsPointCloudAttributeCollection attributes)
protected

Sets native attributes of the data.

Definition at line 219 of file qgspointcloudindex.cpp.

◆ setSubsetString()

bool QgsAbstractPointCloudIndex::setSubsetString ( const QString &  subset)

Sets the string used to define a subset of the point cloud.

Parameters
subsetThe subset string to be used in a QgsPointCloudExpression
Returns
true if the expression is parsed with no errors, false otherwise
Since
QGIS 3.26

Definition at line 229 of file qgspointcloudindex.cpp.

◆ span()

int QgsAbstractPointCloudIndex::span ( ) const

Returns the number of points in one direction in a single node.

Definition at line 224 of file qgspointcloudindex.cpp.

◆ storeNodeDataToCache()

void QgsAbstractPointCloudIndex::storeNodeDataToCache ( QgsPointCloudBlock data,
const QgsPointCloudNodeId node,
const QgsPointCloudRequest request 
) const

Stores existing data to the cache for the specified node and request.

Ownership is not transferred, block gets cloned in the cache.

Definition at line 302 of file qgspointcloudindex.cpp.

◆ storeNodeDataToCacheStatic()

void QgsAbstractPointCloudIndex::storeNodeDataToCacheStatic ( QgsPointCloudBlock data,
const QgsPointCloudNodeId node,
const QgsPointCloudRequest request,
const QgsPointCloudExpression &  expression,
const QString &  uri 
)
static

Stores existing data to the cache for the specified node, request, expression and uri.

Ownership is not transferred, block gets cloned in the cache.

Definition at line 307 of file qgspointcloudindex.cpp.

◆ subsetString()

QString QgsAbstractPointCloudIndex::subsetString ( ) const

Returns the string used to define a subset of the point cloud.

Returns
The subset string or null QString if not implemented by the provider
Since
QGIS 3.26

Definition at line 253 of file qgspointcloudindex.cpp.

◆ updateNodeData()

bool QgsAbstractPointCloudIndex::updateNodeData ( const QHash< QgsPointCloudNodeId, QByteArray > &  data)
virtual

Tries to update the data for the specified nodes.

Subclasses that support editing should override this to handle storing the data. Default implementation does nothing, returns false.

Returns
true on success, otherwise false
Since
QGIS 3.42

Reimplemented in QgsPointCloudEditingIndex.

Definition at line 199 of file qgspointcloudindex.cpp.

◆ writeStatistics()

bool QgsAbstractPointCloudIndex::writeStatistics ( QgsPointCloudStatistics stats)
virtual

Writes the statistics object stats into the backing file, if possible.

Returns true if the data was written successfully.

Since
QGIS 3.26

Definition at line 271 of file qgspointcloudindex.cpp.

◆ zMax()

double QgsAbstractPointCloudIndex::zMax ( ) const
inline

Returns z max.

Definition at line 317 of file qgspointcloudindex.h.

◆ zMin()

double QgsAbstractPointCloudIndex::zMin ( ) const
inline

Returns z min.

Definition at line 315 of file qgspointcloudindex.h.

Member Data Documentation

◆ mAttributes

QgsPointCloudAttributeCollection QgsAbstractPointCloudIndex::mAttributes
protected

Definition at line 393 of file qgspointcloudindex.h.

◆ mError

QString QgsAbstractPointCloudIndex::mError
protected

Definition at line 397 of file qgspointcloudindex.h.

◆ mExtent

QgsRectangle QgsAbstractPointCloudIndex::mExtent
protected

2D extent of data

Definition at line 385 of file qgspointcloudindex.h.

◆ mFilterExpression

QgsPointCloudExpression QgsAbstractPointCloudIndex::mFilterExpression
protected

The filter expression to be evaluated when fetching node data.

Definition at line 395 of file qgspointcloudindex.h.

◆ mHierarchy

QHash<QgsPointCloudNodeId, int> QgsAbstractPointCloudIndex::mHierarchy
mutableprotected

Data hierarchy.

Definition at line 389 of file qgspointcloudindex.h.

◆ mHierarchyMutex

QMutex QgsAbstractPointCloudIndex::mHierarchyMutex
mutableprotected

Definition at line 388 of file qgspointcloudindex.h.

◆ mOffset

QgsVector3D QgsAbstractPointCloudIndex::mOffset
protected

Offset of our int32 coordinates compared to CRS coords.

Definition at line 391 of file qgspointcloudindex.h.

◆ mRootBounds

QgsBox3D QgsAbstractPointCloudIndex::mRootBounds
protected

Bounds of the root node's cube (in int32 coordinates)

Definition at line 392 of file qgspointcloudindex.h.

◆ mScale

QgsVector3D QgsAbstractPointCloudIndex::mScale
protected

Scale of our int32 coordinates compared to CRS coords.

Definition at line 390 of file qgspointcloudindex.h.

◆ mSpan

int QgsAbstractPointCloudIndex::mSpan = 0
protected

All native attributes stored in the file.

Number of points in one direction in a single node

Definition at line 394 of file qgspointcloudindex.h.

◆ mUri

QString QgsAbstractPointCloudIndex::mUri
protected

Definition at line 398 of file qgspointcloudindex.h.

◆ mZMax

double QgsAbstractPointCloudIndex::mZMax = 0
protected

Vertical extent of data.

Definition at line 386 of file qgspointcloudindex.h.

◆ mZMin

double QgsAbstractPointCloudIndex::mZMin = 0
protected

Definition at line 386 of file qgspointcloudindex.h.

◆ sBlockCache

QCache< QgsPointCloudCacheKey, QgsPointCloudBlock > QgsAbstractPointCloudIndex::sBlockCache
staticprotected

Definition at line 400 of file qgspointcloudindex.h.

◆ sBlockCacheMutex

QMutex QgsAbstractPointCloudIndex::sBlockCacheMutex
staticprotected

Definition at line 399 of file qgspointcloudindex.h.


The documentation for this class was generated from the following files: