Class: QgsPointCloudLayerExporter¶
- class qgis.core.QgsPointCloudLayerExporter¶
Bases:
sip.wrapper
Handles exporting point cloud layers to memory layers, OGR supported files and PDAL supported files.
New in version 3.28.
QgsPointCloudLayerExporter(layer:
QgsPointCloudLayer
) Constructor forQgsPointCloudLayerExporter
, associated with the specifiedlayer
.Note
The
layer
is safe to be deleted once it’s used in the constructor.Enums
Bases:
enum.IntEnum
Methods
Gets the list of point cloud attributes that will be exported.
Gets the
crs
for the exported file.Performs the actual exporting operation.
Gets a pointer to the
QgsFeedback
object used for cancellation / progress reporting, or None if not set.Gets the filename for the new layer.
Gets the filter extent for points to be exported.
Returns the format for the exported file or layer.
Gets the last error that occurred during the exporting operation.
Gets the name for the new layer.
Gets the maximum number of points to be exported.
Creates the
QgsVectorLayer
for exporting to a memory layer, if necessary.Sets whether an existing output vector file should be overwritten on appended to.
Sets that all attributes will be exported.
Sets the list of point cloud
attributes
that will be exported.Sets the
crs
for the exported file, and the transformcontext
that will be used for reprojection if different from the point cloud layer's CRS.Sets a
QgsFeedback
object to allow cancellation / progress reporting.Sets the
filename
for the new layer.Sets a filter extent for points to be exported in the target CRS Points that fall outside the extent will be skipped.
Sets a spatial filter for points to be exported based on
geom
in the point cloud's CRS.Sets the
format
for the exported file.Sets the
name
for the new layer.Sets that no attributes will be exported.
Sets the maximum number of points to be exported.
Sets an inclusive range for Z values to be exported.
Gets a pointer to the exported layer.
Gets the inclusive range for Z values to be exported.
- class ExportFormat(value)¶
Bases:
enum.IntEnum
Supported export formats for point clouds
Memory
: Memory layerLas
: LAS/LAZ point cloudGpkg
: GeopackageShp
: ESRI ShapeFileDxf
: AutoCAD dxfCsv
: Comma separated values
- Csv = 5¶
- Dxf = 4¶
- Gpkg = 2¶
- Las = 1¶
- Memory = 0¶
- Shp = 3¶
- attributes(self) List[str] ¶
Gets the list of point cloud attributes that will be exported.
- Return type:
List[str]
- crs(self) QgsCoordinateReferenceSystem ¶
Gets the
crs
for the exported file.- Return type:
- doExport(self)¶
Performs the actual exporting operation.
- feedback(self) QgsFeedback ¶
Gets a pointer to the
QgsFeedback
object used for cancellation / progress reporting, or None if not set.- Return type:
- fileName(self) str ¶
Gets the filename for the new layer.
- Return type:
str
- filterExtent(self) QgsRectangle ¶
Gets the filter extent for points to be exported.
- Return type:
- format(self) QgsPointCloudLayerExporter.ExportFormat ¶
Returns the format for the exported file or layer.
- Return type:
- lastError(self) str ¶
Gets the last error that occurred during the exporting operation. If no error occurred an empty string is returned.
- Return type:
str
- layerName(self) str ¶
Gets the name for the new layer.
- Return type:
str
- pointsLimit(self) int ¶
Gets the maximum number of points to be exported. 0 means no limit.
- Return type:
int
- prepareExport(self)¶
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 bydoExport()
.
- setActionOnExistingFile(self, action: QgsVectorFileWriter.ActionOnExistingFile)¶
Sets whether an existing output vector file should be overwritten on appended to.
Note
Only applies to vector formats
- Parameters:
action (QgsVectorFileWriter.ActionOnExistingFile) –
- setAllAttributes(self)¶
Sets that all attributes will be exported.
- setAttributes(self, attributes: Iterable[str])¶
Sets the list of point cloud
attributes
that will be exported. If never called, all attributes will be exported.Note
This has no effect when exporting to LAS/LAZ format.
- Parameters:
attributes (Iterable[str]) –
- setCrs(self, crs: QgsCoordinateReferenceSystem, context: QgsCoordinateTransformContext = QgsCoordinateTransformContext())¶
Sets the
crs
for the exported file, and the transformcontext
that will be used for reprojection if different from the point cloud layer’s CRS.- Parameters:
crs (QgsCoordinateReferenceSystem) –
context (
QgsCoordinateTransformContext
= QgsCoordinateTransformContext()) –
- setFeedback(self, feedback: QgsFeedback)¶
Sets a
QgsFeedback
object to allow cancellation / progress reporting.Note
The
feedback
object must exist for the lifetime of the exporter.- Parameters:
feedback (QgsFeedback) –
- setFileName(self, filename: str)¶
Sets the
filename
for the new layer.- Parameters:
filename (str) –
- setFilterExtent(self, extent: QgsRectangle)¶
Sets a filter extent for points to be exported in the target CRS Points that fall outside the extent will be skipped.
See also
- Parameters:
extent (QgsRectangle) –
- setFilterGeometry(self, geometry: QgsAbstractGeometry)¶
Sets a spatial filter for points to be exported based on
geom
in the point cloud’s CRS. Points that do not intersectgeometry
will be skipped.setFilterGeometry(self, layer:
QgsMapLayer
, selectedFeaturesOnly: bool = False) Sets a spatial filter for points to be exported based on the features oflayer
. Points that do not intersect thelayer
’s features will be skipped.- Parameters:
geometry (QgsAbstractGeometry) –
- setFormat(self, format: QgsPointCloudLayerExporter.ExportFormat) bool ¶
Sets the
format
for the exported file.- Return type:
bool
- Returns:
true if the
format
is supported, false otherwise.
See also
ExportFormat
- Parameters:
format (QgsPointCloudLayerExporter.ExportFormat) –
- setLayerName(self, name: str)¶
Sets the
name
for the new layer.- Parameters:
name (str) –
- setNoAttributes(self)¶
Sets that no attributes will be exported.
Note
This has no effect when exporting to LAS/LAZ format.
- setPointsLimit(self, limit: int)¶
Sets the maximum number of points to be exported. Default value is 0.
Note
Any
limit
value <= 0 means no limit.- Parameters:
limit (int) –
- setZRange(self, zRange: QgsDoubleRange)¶
Sets an inclusive range for Z values to be exported. Points with Z values outside the range will be skipped.
- Parameters:
zRange (QgsDoubleRange) –
- takeExportedLayer(self) QgsMapLayer ¶
Gets a pointer to the exported layer. Caller takes ownership of the returned object.
- Return type:
- zRange(self) QgsDoubleRange ¶
Gets the inclusive range for Z values to be exported.
- Return type: