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

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

#include <qgspointcloudindex.h>

Public Types

enum  AccessType { Local , Remote }
 The access type of the data, local is for local files and remote for remote files (over HTTP) More...
 

Public Member Functions

 QgsPointCloudIndex ()
 Constructs index.
 
virtual ~QgsPointCloudIndex ()
 
virtual AccessType 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< QgsPointCloudIndexclone () const =0
 Returns a clone of the current point cloud index object.
 
void copyCommonProperties (QgsPointCloudIndex *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 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 ()
 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.
 
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.18

Definition at line 202 of file qgspointcloudindex.h.

Member Enumeration Documentation

◆ AccessType

The access type of the data, local is for local files and remote for remote files (over HTTP)

Enumerator
Local 

Local means the source is a local file on the machine.

Remote 

Remote means it's loaded through a protocol like HTTP.

Definition at line 206 of file qgspointcloudindex.h.

Constructor & Destructor Documentation

◆ QgsPointCloudIndex()

QgsPointCloudIndex::QgsPointCloudIndex ( )
explicitdefault

Constructs index.

◆ ~QgsPointCloudIndex()

QgsPointCloudIndex::~QgsPointCloudIndex ( )
virtualdefault

Member Function Documentation

◆ accessType()

virtual AccessType QgsPointCloudIndex::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

◆ asyncNodeData()

virtual QgsPointCloudBlockRequest * QgsPointCloudIndex::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

◆ attributes()

QgsPointCloudAttributeCollection QgsPointCloudIndex::attributes ( ) const

Returns all attributes that are stored in the file.

Definition at line 196 of file qgspointcloudindex.cpp.

◆ clone()

virtual std::unique_ptr< QgsPointCloudIndex > QgsPointCloudIndex::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

◆ copyCommonProperties()

void QgsPointCloudIndex::copyCommonProperties ( QgsPointCloudIndex destination) const

Copies common properties to the destination index.

Since
QGIS 3.26

Definition at line 263 of file qgspointcloudindex.cpp.

◆ crs()

virtual QgsCoordinateReferenceSystem QgsPointCloudIndex::crs ( ) const
pure virtual

Returns the coordinate reference system of the point cloud index.

◆ error()

QString QgsPointCloudIndex::error ( ) const
inline

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

Since
QGIS 3.26

Definition at line 233 of file qgspointcloudindex.h.

◆ extent()

QgsRectangle QgsPointCloudIndex::extent ( ) const
inline

Returns extent of the data.

Definition at line 291 of file qgspointcloudindex.h.

◆ getNode()

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

Returns object for a given node.

Definition at line 166 of file qgspointcloudindex.cpp.

◆ getNodeDataFromCache()

QgsPointCloudBlock * QgsPointCloudIndex::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 279 of file qgspointcloudindex.cpp.

◆ hasNode()

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

Returns whether the octree contain given node.

Definition at line 160 of file qgspointcloudindex.cpp.

◆ isValid()

virtual bool QgsPointCloudIndex::isValid ( ) const
pure virtual

Returns whether index is loaded and valid.

◆ load()

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

Loads the index from the file.

◆ metadataStatistics()

QgsPointCloudStatistics QgsPointCloudIndex::metadataStatistics ( ) const
virtual

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

Since
QGIS 3.26

Definition at line 250 of file qgspointcloudindex.cpp.

◆ nodeData()

virtual std::unique_ptr< QgsPointCloudBlock > QgsPointCloudIndex::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

◆ offset()

QgsVector3D QgsPointCloudIndex::offset ( ) const

Returns offset of data from CRS.

Definition at line 206 of file qgspointcloudindex.cpp.

◆ originalMetadata()

virtual QVariantMap QgsPointCloudIndex::originalMetadata ( ) const
pure virtual

Returns the original metadata map.

◆ pointCount()

virtual qint64 QgsPointCloudIndex::pointCount ( ) const
pure virtual

Returns the number of points in the point cloud.

◆ root()

QgsPointCloudNodeId QgsPointCloudIndex::root ( )
inline

Returns root node of the index.

Definition at line 257 of file qgspointcloudindex.h.

◆ rootNodeBounds()

QgsBox3D QgsPointCloudIndex::rootNodeBounds ( ) const
inline

Returns bounding box of root node in CRS coords.

Definition at line 299 of file qgspointcloudindex.h.

◆ scale()

QgsVector3D QgsPointCloudIndex::scale ( ) const

Returns scale of data relative to CRS.

Definition at line 201 of file qgspointcloudindex.cpp.

◆ setAttributes()

void QgsPointCloudIndex::setAttributes ( const QgsPointCloudAttributeCollection attributes)
protected

Sets native attributes of the data.

Definition at line 211 of file qgspointcloudindex.cpp.

◆ setSubsetString()

bool QgsPointCloudIndex::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 221 of file qgspointcloudindex.cpp.

◆ span()

int QgsPointCloudIndex::span ( ) const

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

Definition at line 216 of file qgspointcloudindex.cpp.

◆ storeNodeDataToCache()

void QgsPointCloudIndex::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 288 of file qgspointcloudindex.cpp.

◆ storeNodeDataToCacheStatic()

void QgsPointCloudIndex::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 293 of file qgspointcloudindex.cpp.

◆ subsetString()

QString QgsPointCloudIndex::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 245 of file qgspointcloudindex.cpp.

◆ zMax()

double QgsPointCloudIndex::zMax ( ) const
inline

Returns z max.

Definition at line 296 of file qgspointcloudindex.h.

◆ zMin()

double QgsPointCloudIndex::zMin ( ) const
inline

Returns z min.

Definition at line 294 of file qgspointcloudindex.h.

Member Data Documentation

◆ mAttributes

QgsPointCloudAttributeCollection QgsPointCloudIndex::mAttributes
protected

Definition at line 364 of file qgspointcloudindex.h.

◆ mError

QString QgsPointCloudIndex::mError
protected

Definition at line 368 of file qgspointcloudindex.h.

◆ mExtent

QgsRectangle QgsPointCloudIndex::mExtent
protected

2D extent of data

Definition at line 356 of file qgspointcloudindex.h.

◆ mFilterExpression

QgsPointCloudExpression QgsPointCloudIndex::mFilterExpression
protected

The filter expression to be evaluated when fetching node data.

Definition at line 366 of file qgspointcloudindex.h.

◆ mHierarchy

QHash<QgsPointCloudNodeId, int> QgsPointCloudIndex::mHierarchy
mutableprotected

Data hierarchy.

Definition at line 360 of file qgspointcloudindex.h.

◆ mHierarchyMutex

QMutex QgsPointCloudIndex::mHierarchyMutex
mutableprotected

Definition at line 359 of file qgspointcloudindex.h.

◆ mOffset

QgsVector3D QgsPointCloudIndex::mOffset
protected

Offset of our int32 coordinates compared to CRS coords.

Definition at line 362 of file qgspointcloudindex.h.

◆ mRootBounds

QgsBox3D QgsPointCloudIndex::mRootBounds
protected

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

Definition at line 363 of file qgspointcloudindex.h.

◆ mScale

QgsVector3D QgsPointCloudIndex::mScale
protected

Scale of our int32 coordinates compared to CRS coords.

Definition at line 361 of file qgspointcloudindex.h.

◆ mSpan

int QgsPointCloudIndex::mSpan = 0
protected

All native attributes stored in the file.

Number of points in one direction in a single node

Definition at line 365 of file qgspointcloudindex.h.

◆ mUri

QString QgsPointCloudIndex::mUri
protected

Definition at line 369 of file qgspointcloudindex.h.

◆ mZMax

double QgsPointCloudIndex::mZMax = 0
protected

Vertical extent of data.

Definition at line 357 of file qgspointcloudindex.h.

◆ mZMin

double QgsPointCloudIndex::mZMin = 0
protected

Definition at line 357 of file qgspointcloudindex.h.

◆ sBlockCache

QCache< QgsPointCloudCacheKey, QgsPointCloudBlock > QgsPointCloudIndex::sBlockCache
staticprotected

Definition at line 371 of file qgspointcloudindex.h.

◆ sBlockCacheMutex

QMutex QgsPointCloudIndex::sBlockCacheMutex
staticprotected

Definition at line 370 of file qgspointcloudindex.h.


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