QGIS API Documentation 3.39.0-Master (699c004a5df)
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
QgsGeometrySnapperSingleSource Class Reference

Makes sure that any two vertices of the vector layer are at least at distance given by the threshold value. More...

#include <qgsgeometrysnappersinglesource.h>

Static Public Member Functions

static int run (const QgsFeatureSource &source, QgsFeatureSink &sink, double thresh, QgsFeedback *feedback)
 Run the algorithm on given source and output results to the sink, using threshold value in the source's map units.
 

Detailed Description

Makes sure that any two vertices of the vector layer are at least at distance given by the threshold value.

The algorithm moves nearby vertices to one location and adds vertices to segments that are passing around other vertices within the threshold. It does not remove any vertices. Also, it does not modify geometries unless needed (it does not snap coordinates to a grid).

This algorithm comes handy when doing vector overlay operations such as intersection, union or difference to prevent possible topological errors caused by numerical errors if coordinates are very close to each other.

After running the algorithm some previously valid geometries may become invalid and therefore it may be useful to run Fix geometries algorithm afterwards.

Note
Originally ported from GRASS implementation of Vect_snap_lines_list()
Since
QGIS 3.4

Definition at line 44 of file qgsgeometrysnappersinglesource.h.

Member Function Documentation

◆ run()

int QgsGeometrySnapperSingleSource::run ( const QgsFeatureSource source,
QgsFeatureSink sink,
double  thresh,
QgsFeedback feedback 
)
static

Run the algorithm on given source and output results to the sink, using threshold value in the source's map units.

Returns number of modified geometries.

Definition at line 305 of file qgsgeometrysnappersinglesource.cpp.


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