QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
|
Handles exporting point cloud layers to memory layers, OGR supported files and PDAL supported files. More...
#include <qgspointcloudlayerexporter.h>
Public Types | |
enum class | ExportFormat : int { Memory = 0 , Las = 1 , Gpkg = 2 , Shp = 3 , Dxf = 4 , Csv = 5 } |
Supported export formats for point clouds. More... | |
Public Member Functions | |
QgsPointCloudLayerExporter (QgsPointCloudLayer *layer) | |
Constructor for QgsPointCloudLayerExporter, associated with the specified layer. | |
~QgsPointCloudLayerExporter () | |
QStringList | attributes () const |
Gets the list of point cloud attributes that will be exported. | |
QgsCoordinateReferenceSystem | crs () const |
Gets the crs for the exported file. | |
void | doExport () |
Performs the actual exporting operation. | |
QgsFeedback * | feedback () const |
Gets a pointer to the QgsFeedback object used for cancellation / progress reporting, or nullptr if not set. | |
QString | fileName () const |
Gets the filename for the new layer. | |
QgsRectangle | filterExtent () const |
Gets the filter extent for points to be exported. | |
ExportFormat | format () const |
Returns the format for the exported file or layer. | |
QString | lastError () const |
Gets the last error that occurred during the exporting operation. | |
QString | layerName () const |
Gets the name for the new layer. | |
qint64 | pointsLimit () |
Gets the maximum number of points to be exported. | |
void | prepareExport () |
Creates the QgsVectorLayer for exporting to a memory layer, if necessary. | |
void | setActionOnExistingFile (const QgsVectorFileWriter::ActionOnExistingFile action) |
Sets whether an existing output vector file should be overwritten on appended to. | |
void | setAllAttributes () |
Sets that all attributes will be exported. | |
void | setAttributes (const QStringList &attributes) |
Sets the list of point cloud attributes that will be exported. | |
void | setCrs (const QgsCoordinateReferenceSystem &crs, const QgsCoordinateTransformContext &context=QgsCoordinateTransformContext()) |
Sets the crs for the exported file, and the transform context that will be used for reprojection if different from the point cloud layer's CRS. | |
void | setFeedback (QgsFeedback *feedback) |
Sets a QgsFeedback object to allow cancellation / progress reporting. | |
void | setFileName (const QString &filename) |
Sets the filename for the new layer. | |
void | setFilterExtent (const QgsRectangle extent) |
Sets a filter extent for points to be exported in the target CRS Points that fall outside the extent will be skipped. | |
void | setFilterGeometry (const QgsAbstractGeometry *geometry) |
Sets a spatial filter for points to be exported based on geom in the point cloud's CRS. | |
void | setFilterGeometry (QgsMapLayer *layer, bool selectedFeaturesOnly=false) |
Sets a spatial filter for points to be exported based on the features of layer. | |
bool | setFormat (const ExportFormat format) |
Sets the format for the exported file. | |
void | setLayerName (const QString &name) |
Sets the name for the new layer. | |
void | setNoAttributes () |
Sets that no attributes will be exported. | |
void | setPointsLimit (qint64 limit) |
Sets the maximum number of points to be exported. | |
void | setZRange (const QgsDoubleRange zRange) |
Sets an inclusive range for Z values to be exported. | |
QgsMapLayer * | takeExportedLayer () |
Gets a pointer to the exported layer. | |
QgsDoubleRange | zRange () const |
Gets the inclusive range for Z values to be exported. | |
Static Public Member Functions | |
static QString | getOgrDriverName (ExportFormat format) |
Gets the OGR driver name for the specified format. | |
static QList< ExportFormat > | supportedFormats () |
Gets a list of the supported export formats. | |
Handles exporting point cloud layers to memory layers, OGR supported files and PDAL supported files.
Definition at line 44 of file qgspointcloudlayerexporter.h.
|
strong |
Supported export formats for point clouds.
Enumerator | |
---|---|
Memory | Memory layer. |
Las | LAS/LAZ point cloud. |
Gpkg | Geopackage. |
Shp | ESRI ShapeFile. |
Dxf | AutoCAD dxf. |
Csv | Comma separated values. |
Definition at line 51 of file qgspointcloudlayerexporter.h.
QgsPointCloudLayerExporter::QgsPointCloudLayerExporter | ( | QgsPointCloudLayer * | layer | ) |
Constructor for QgsPointCloudLayerExporter, associated with the specified layer.
Definition at line 55 of file qgspointcloudlayerexporter.cpp.
QgsPointCloudLayerExporter::~QgsPointCloudLayerExporter | ( | ) |
Definition at line 69 of file qgspointcloudlayerexporter.cpp.
|
inline |
Gets the list of point cloud attributes that will be exported.
Definition at line 183 of file qgspointcloudlayerexporter.h.
|
inline |
Gets the crs for the exported file.
Definition at line 194 of file qgspointcloudlayerexporter.h.
void QgsPointCloudLayerExporter::doExport | ( | ) |
Performs the actual exporting operation.
Definition at line 205 of file qgspointcloudlayerexporter.cpp.
|
inline |
Gets a pointer to the QgsFeedback object used for cancellation / progress reporting, or nullptr if not set.
Definition at line 160 of file qgspointcloudlayerexporter.h.
|
inline |
Gets the filename for the new layer.
Definition at line 103 of file qgspointcloudlayerexporter.h.
|
inline |
Gets the filter extent for points to be exported.
Definition at line 125 of file qgspointcloudlayerexporter.h.
|
inline |
Returns the format for the exported file or layer.
Definition at line 206 of file qgspointcloudlayerexporter.h.
|
static |
Gets the OGR driver name for the specified format.
Definition at line 36 of file qgspointcloudlayerexporter.cpp.
|
inline |
Gets the last error that occurred during the exporting operation.
If no error occurred an empty string is returned.
Definition at line 247 of file qgspointcloudlayerexporter.h.
|
inline |
Gets the name for the new layer.
Definition at line 113 of file qgspointcloudlayerexporter.h.
|
inline |
Gets the maximum number of points to be exported.
0 means no limit.
Definition at line 217 of file qgspointcloudlayerexporter.h.
void QgsPointCloudLayerExporter::prepareExport | ( | ) |
Creates the QgsVectorLayer for exporting to a memory layer, if necessary.
This method allows the exported memory layer to be created in the main thread. If not explicitly called, this method will be implicitly called by doExport().
Definition at line 191 of file qgspointcloudlayerexporter.cpp.
|
inline |
Sets whether an existing output vector file should be overwritten on appended to.
Definition at line 223 of file qgspointcloudlayerexporter.h.
void QgsPointCloudLayerExporter::setAllAttributes | ( | ) |
Sets that all attributes will be exported.
Definition at line 149 of file qgspointcloudlayerexporter.cpp.
void QgsPointCloudLayerExporter::setAttributes | ( | const QStringList & | attributes | ) |
Sets the list of point cloud attributes that will be exported.
If never called, all attributes will be exported.
Definition at line 130 of file qgspointcloudlayerexporter.cpp.
|
inline |
Sets the crs for the exported file, and the transform context that will be used for reprojection if different from the point cloud layer's CRS.
Definition at line 189 of file qgspointcloudlayerexporter.h.
|
inline |
Sets a QgsFeedback object to allow cancellation / progress reporting.
Definition at line 155 of file qgspointcloudlayerexporter.h.
|
inline |
Sets the filename for the new layer.
Definition at line 98 of file qgspointcloudlayerexporter.h.
|
inline |
Sets a filter extent for points to be exported in the target CRS Points that fall outside the extent will be skipped.
Definition at line 120 of file qgspointcloudlayerexporter.h.
void QgsPointCloudLayerExporter::setFilterGeometry | ( | const QgsAbstractGeometry * | geometry | ) |
Sets a spatial filter for points to be exported based on geom in the point cloud's CRS.
Points that do not intersect geometry will be skipped.
Definition at line 86 of file qgspointcloudlayerexporter.cpp.
void QgsPointCloudLayerExporter::setFilterGeometry | ( | QgsMapLayer * | layer, |
bool | selectedFeaturesOnly = false |
||
) |
Sets a spatial filter for points to be exported based on the features of layer.
Points that do not intersect the layer's features will be skipped.
Definition at line 92 of file qgspointcloudlayerexporter.cpp.
bool QgsPointCloudLayerExporter::setFormat | ( | const ExportFormat | format | ) |
Sets the format for the exported file.
Definition at line 76 of file qgspointcloudlayerexporter.cpp.
|
inline |
Sets the name for the new layer.
Definition at line 108 of file qgspointcloudlayerexporter.h.
|
inline |
Sets that no attributes will be exported.
Definition at line 173 of file qgspointcloudlayerexporter.h.
|
inline |
Sets the maximum number of points to be exported.
Default value is 0.
Definition at line 212 of file qgspointcloudlayerexporter.h.
|
inline |
Sets an inclusive range for Z values to be exported.
Points with Z values outside the range will be skipped.
Definition at line 143 of file qgspointcloudlayerexporter.h.
|
inlinestatic |
Gets a list of the supported export formats.
Definition at line 66 of file qgspointcloudlayerexporter.h.
QgsMapLayer * QgsPointCloudLayerExporter::takeExportedLayer | ( | ) |
Gets a pointer to the exported layer.
Caller takes ownership of the returned object.
Definition at line 279 of file qgspointcloudlayerexporter.cpp.
|
inline |
Gets the inclusive range for Z values to be exported.
Definition at line 148 of file qgspointcloudlayerexporter.h.