QGIS API Documentation 3.30.0-'s-Hertogenbosch (f186b8efe0)
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
QgsPointCloudIndex Class Referenceabstract

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

#include <qgspointcloudindex.h>

Inheritance diagram for QgsPointCloudIndex:
Inheritance graph
[legend]

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. More...
 
 ~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 ) More...
 
virtual QgsPointCloudBlockRequestasyncNodeData (const IndexedPointCloudNode &n, const QgsPointCloudRequest &request)=0
 Returns a handle responsible for loading a node data block. More...
 
QgsPointCloudAttributeCollection attributes () const
 Returns all attributes that are stored in the file. More...
 
virtual std::unique_ptr< QgsPointCloudIndexclone () const =0
 Returns a clone of the current point cloud index object. More...
 
void copyCommonProperties (QgsPointCloudIndex *destination) const
 Copies common properties to the destination index. More...
 
virtual QgsCoordinateReferenceSystem crs () const =0
 Returns the coordinate reference system of the point cloud index. More...
 
QString error () const
 Returns the error that occurred during the loading of the index. More...
 
QgsRectangle extent () const
 Returns extent of the data. More...
 
virtual bool hasNode (const IndexedPointCloudNode &n) const
 Returns whether the octree contain given node. More...
 
virtual bool hasStatisticsMetadata () const =0
 Returns whether the dataset contains metadata of statistics. More...
 
virtual bool isValid () const =0
 Returns whether index is loaded and valid. More...
 
virtual void load (const QString &fileName)=0
 Loads the index from the file. More...
 
virtual QVariantList metadataClasses (const QString &attribute) const
 Returns the classes of attribute. More...
 
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. More...
 
virtual QVariant metadataStatistic (const QString &attribute, QgsStatisticalSummary::Statistic statistic) const
 Returns the statistic statistic of attribute. More...
 
virtual QgsPointCloudStatistics metadataStatistics () const
 Returns the object containings the statistics metadata extracted from the dataset. More...
 
QgsPointCloudDataBounds nodeBounds (const IndexedPointCloudNode &node) const
 Returns bounds of particular node. More...
 
virtual QList< IndexedPointCloudNodenodeChildren (const IndexedPointCloudNode &n) const
 Returns all children of node. More...
 
virtual QgsPointCloudBlocknodeData (const IndexedPointCloudNode &n, const QgsPointCloudRequest &request)=0
 Returns node data block. More...
 
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 current view) More...
 
QgsRectangle nodeMapExtent (const IndexedPointCloudNode &node) const
 Returns the extent of a node in map coordinates. More...
 
int nodePointCount (const IndexedPointCloudNode &n)
 Returns the number of points of indexed point cloud node n. More...
 
virtual qint64 nodePointCount (const IndexedPointCloudNode &n) const
 Returns the number of points of a given node n. More...
 
QgsDoubleRange nodeZRange (const IndexedPointCloudNode &node) const
 Returns the z range of a node. More...
 
QgsVector3D offset () const
 Returns offset. More...
 
virtual QVariantMap originalMetadata () const =0
 Returns the original metadata map. More...
 
virtual qint64 pointCount () const =0
 Returns the number of points in the point cloud. More...
 
IndexedPointCloudNode root ()
 Returns root node of the index. More...
 
QgsVector3D scale () const
 Returns scale. More...
 
bool setSubsetString (const QString &subset)
 Sets the string used to define a subset of the point cloud. More...
 
int span () const
 Returns the number of points in one direction in a single node. More...
 
QString subsetString () const
 Returns the string used to define a subset of the point cloud. More...
 
double zMax () const
 Returns z max. More...
 
double zMin () const
 Returns z min. More...
 

Protected Member Functions

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

Protected Attributes

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

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 163 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 168 of file qgspointcloudindex.h.

Constructor & Destructor Documentation

◆ QgsPointCloudIndex()

QgsPointCloudIndex::QgsPointCloudIndex ( )
explicitdefault

Constructs index.

◆ ~QgsPointCloudIndex()

QgsPointCloudIndex::~QgsPointCloudIndex ( )
default

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 IndexedPointCloudNode 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 192 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 352 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 195 of file qgspointcloudindex.h.

◆ extent()

QgsRectangle QgsPointCloudIndex::extent ( ) const
inline

Returns extent of the data.

Definition at line 266 of file qgspointcloudindex.h.

◆ hasNode()

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

Returns whether the octree contain given node.

Definition at line 160 of file qgspointcloudindex.cpp.

◆ hasStatisticsMetadata()

virtual bool QgsPointCloudIndex::hasStatisticsMetadata ( ) const
pure virtual

Returns whether the dataset contains metadata of statistics.

◆ 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.

◆ metadataClasses()

QVariantList QgsPointCloudIndex::metadataClasses ( const QString &  attribute) const
virtual

Returns the classes of attribute.

Definition at line 309 of file qgspointcloudindex.cpp.

◆ metadataClassStatistic()

QVariant QgsPointCloudIndex::metadataClassStatistic ( const QString &  attribute,
const QVariant &  value,
QgsStatisticalSummary::Statistic  statistic 
) const
virtual

Returns the statistic statistic of the class value of the attribute attribute.

Definition at line 315 of file qgspointcloudindex.cpp.

◆ metadataStatistic()

QVariant QgsPointCloudIndex::metadataStatistic ( const QString &  attribute,
QgsStatisticalSummary::Statistic  statistic 
) const
virtual

Returns the statistic statistic of attribute.

Definition at line 289 of file qgspointcloudindex.cpp.

◆ metadataStatistics()

QgsPointCloudStatistics QgsPointCloudIndex::metadataStatistics ( ) const
virtual

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

Since
QGIS 3.26

Definition at line 323 of file qgspointcloudindex.cpp.

◆ nodeBounds()

QgsPointCloudDataBounds QgsPointCloudIndex::nodeBounds ( const IndexedPointCloudNode node) const

Returns bounds of particular node.

Definition at line 197 of file qgspointcloudindex.cpp.

◆ nodeChildren()

QList< IndexedPointCloudNode > QgsPointCloudIndex::nodeChildren ( const IndexedPointCloudNode n) const
virtual

Returns all children of node.

Definition at line 172 of file qgspointcloudindex.cpp.

◆ nodeData()

virtual QgsPointCloudBlock * QgsPointCloudIndex::nodeData ( const IndexedPointCloudNode 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

It is caller responsibility to free the block.

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

◆ nodeError()

float QgsPointCloudIndex::nodeError ( const IndexedPointCloudNode n) const

Returns node's error in map units (used to determine in whether the node has enough detail for the current view)

Definition at line 226 of file qgspointcloudindex.cpp.

◆ nodeMapExtent()

QgsRectangle QgsPointCloudIndex::nodeMapExtent ( const IndexedPointCloudNode node) const

Returns the extent of a node in map coordinates.

See also
nodeZRange()

Definition at line 216 of file qgspointcloudindex.cpp.

◆ nodePointCount() [1/2]

int QgsPointCloudIndex::nodePointCount ( const IndexedPointCloudNode n)

Returns the number of points of indexed point cloud node n.

Definition at line 252 of file qgspointcloudindex.cpp.

◆ nodePointCount() [2/2]

qint64 QgsPointCloudIndex::nodePointCount ( const IndexedPointCloudNode n) const
virtual

Returns the number of points of a given node n.

Definition at line 166 of file qgspointcloudindex.cpp.

◆ nodeZRange()

QgsDoubleRange QgsPointCloudIndex::nodeZRange ( const IndexedPointCloudNode node) const

Returns the z range of a node.

See also
nodeMapExtent()

Definition at line 221 of file qgspointcloudindex.cpp.

◆ offset()

QgsVector3D QgsPointCloudIndex::offset ( ) const

Returns offset.

Definition at line 237 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()

IndexedPointCloudNode QgsPointCloudIndex::root ( )
inline

Returns root node of the index.

Definition at line 227 of file qgspointcloudindex.h.

◆ scale()

QgsVector3D QgsPointCloudIndex::scale ( ) const

Returns scale.

Definition at line 232 of file qgspointcloudindex.cpp.

◆ setAttributes()

void QgsPointCloudIndex::setAttributes ( const QgsPointCloudAttributeCollection attributes)
protected

Sets native attributes of the data.

Definition at line 242 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 260 of file qgspointcloudindex.cpp.

◆ span()

int QgsPointCloudIndex::span ( ) const

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

Definition at line 247 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 284 of file qgspointcloudindex.cpp.

◆ zMax()

double QgsPointCloudIndex::zMax ( ) const
inline

Returns z max.

Definition at line 271 of file qgspointcloudindex.h.

◆ zMin()

double QgsPointCloudIndex::zMin ( ) const
inline

Returns z min.

Definition at line 269 of file qgspointcloudindex.h.

Member Data Documentation

◆ mAttributes

QgsPointCloudAttributeCollection QgsPointCloudIndex::mAttributes
protected

Definition at line 343 of file qgspointcloudindex.h.

◆ mError

QString QgsPointCloudIndex::mError
protected

Definition at line 347 of file qgspointcloudindex.h.

◆ mExtent

QgsRectangle QgsPointCloudIndex::mExtent
protected

2D extent of data

Definition at line 335 of file qgspointcloudindex.h.

◆ mFilterExpression

QgsPointCloudExpression QgsPointCloudIndex::mFilterExpression
protected

The filter expression to be evaluated when fetching node data.

Definition at line 345 of file qgspointcloudindex.h.

◆ mHierarchy

QHash<IndexedPointCloudNode, int> QgsPointCloudIndex::mHierarchy
mutableprotected

Data hierarchy.

Definition at line 339 of file qgspointcloudindex.h.

◆ mHierarchyMutex

QMutex QgsPointCloudIndex::mHierarchyMutex
mutableprotected

Definition at line 338 of file qgspointcloudindex.h.

◆ mOffset

QgsVector3D QgsPointCloudIndex::mOffset
protected

Offset of our int32 coordinates compared to CRS coords.

Definition at line 341 of file qgspointcloudindex.h.

◆ mRootBounds

QgsPointCloudDataBounds QgsPointCloudIndex::mRootBounds
protected

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

Definition at line 342 of file qgspointcloudindex.h.

◆ mScale

QgsVector3D QgsPointCloudIndex::mScale
protected

Scale of our int32 coordinates compared to CRS coords.

Definition at line 340 of file qgspointcloudindex.h.

◆ mSpan

int QgsPointCloudIndex::mSpan
protected

All native attributes stored in the file.

Number of points in one direction in a single node

Definition at line 344 of file qgspointcloudindex.h.

◆ mZMax

double QgsPointCloudIndex::mZMax = 0
protected

Vertical extent of data.

Definition at line 336 of file qgspointcloudindex.h.

◆ mZMin

double QgsPointCloudIndex::mZMin = 0
protected

Definition at line 336 of file qgspointcloudindex.h.


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