QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
QgsInternalGeometrySnapper Class Reference

QgsInternalGeometrySnapper allows a set of geometries to be snapped to each other. More...

#include <qgsgeometrysnapper.h>

Public Member Functions

 QgsInternalGeometrySnapper (double snapTolerance, QgsGeometrySnapper::SnapMode mode=QgsGeometrySnapper::PreferNodes)
 Constructor for QgsInternalGeometrySnapper.
 
QgsGeometry snapFeature (const QgsFeature &feature)
 Snaps a single feature's geometry against all feature geometries already processed by calls to snapFeature() in this object, and returns the snapped geometry.
 
QgsGeometryMap snappedGeometries () const
 Returns a QgsGeometryMap of all feature geometries snapped by this object.
 

Detailed Description

QgsInternalGeometrySnapper allows a set of geometries to be snapped to each other.

It can be used to close gaps in layers.

To use QgsInternalGeometrySnapper, first construct the snapper using the desired snap parameters. Then, features are fed to to the snapper one-by-one by calling snapFeature(). Each feature passed by calling snapFeature() will be snapped to any features which have already been processed by the snapper.

After processing all desired features, the results can be fetched by calling snappedGeometries(). The returned QgsGeometryMap can be passed to QgsVectorDataProvider::changeGeometryValues() to save the snapped geometries back to the source layer.

Definition at line 134 of file qgsgeometrysnapper.h.

Constructor & Destructor Documentation

◆ QgsInternalGeometrySnapper()

QgsInternalGeometrySnapper::QgsInternalGeometrySnapper ( double  snapTolerance,
QgsGeometrySnapper::SnapMode  mode = QgsGeometrySnapper::PreferNodes 
)

Constructor for QgsInternalGeometrySnapper.

The snapTolerance and mode parameters dictate how geometries will be snapped by the snapper.

Definition at line 603 of file qgsgeometrysnapper.cpp.

Member Function Documentation

◆ snapFeature()

QgsGeometry QgsInternalGeometrySnapper::snapFeature ( const QgsFeature feature)

Snaps a single feature's geometry against all feature geometries already processed by calls to snapFeature() in this object, and returns the snapped geometry.

Definition at line 608 of file qgsgeometrysnapper.cpp.

◆ snappedGeometries()

QgsGeometryMap QgsInternalGeometrySnapper::snappedGeometries ( ) const
inline

Returns a QgsGeometryMap of all feature geometries snapped by this object.

Definition at line 154 of file qgsgeometrysnapper.h.


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