QGIS API Documentation 3.99.0-Master (21b3aa880ba)
Loading...
Searching...
No Matches
QgsGeometryCheckContext Class Reference

Base configuration for geometry checks. More...

#include <qgsgeometrycheckcontext.h>

Public Member Functions

 QgsGeometryCheckContext (int precision, const QgsCoordinateReferenceSystem &mapCrs, const QgsCoordinateTransformContext &transformContext, const QgsProject *mProject=nullptr, const int uniqueIdFieldIndex=-1)
 Creates a new QgsGeometryCheckContext.
const QgsProjectproject () const
 The project can be used to resolve additional layers.

Public Attributes

const QgsCoordinateReferenceSystem mapCrs
 The coordinate system in which calculations should be done.
const double reducedTolerance
 The tolerance to allow for in geometry checks.
const double tolerance
 The tolerance to allow for in geometry checks.
const QgsCoordinateTransformContext transformContext
 The coordinate transform context with which transformations will be done.
const int uniqueIdFieldIndex
 The index of the unique ID field used to identify features.

Detailed Description

Base configuration for geometry checks.

Note
This class is a technology preview and unstable API.
Since
QGIS 3.4

Definition at line 31 of file qgsgeometrycheckcontext.h.

Constructor & Destructor Documentation

◆ QgsGeometryCheckContext()

QgsGeometryCheckContext::QgsGeometryCheckContext ( int precision,
const QgsCoordinateReferenceSystem & mapCrs,
const QgsCoordinateTransformContext & transformContext,
const QgsProject * mProject = nullptr,
const int uniqueIdFieldIndex = -1 )

Creates a new QgsGeometryCheckContext.

Parameters
precisionThe precision used to define geometry check tolerance. Tolerance is calculated as pow(10, -precision)
mapCrsThe coordinate system in which calculations should be done
transformContextThe coordinate transform context
mProjectThe project used to resolve additional layers
uniqueIdFieldIndexThe index of the unique ID field used to identify features. If set to valid field index, geometry checker will fail if this field is not unique (since QGIS 4.0)

Definition at line 20 of file qgsgeometrycheckcontext.cpp.

Member Function Documentation

◆ project()

const QgsProject * QgsGeometryCheckContext::project ( ) const

The project can be used to resolve additional layers.

This must only be accessed from the main thread (i.e. do not access from the collectError method)

Since
QGIS 3.10

Definition at line 30 of file qgsgeometrycheckcontext.cpp.

Member Data Documentation

◆ mapCrs

const QgsCoordinateReferenceSystem QgsGeometryCheckContext::mapCrs

The coordinate system in which calculations should be done.

Definition at line 65 of file qgsgeometrycheckcontext.h.

◆ reducedTolerance

const double QgsGeometryCheckContext::reducedTolerance

The tolerance to allow for in geometry checks.

Will be calculated as pow(10, -precision/2) in the constructor. I.e. if the precision is 4 (decimal digits), this will be 0.01. Should be used for areas, where the precision is squared.

Definition at line 60 of file qgsgeometrycheckcontext.h.

◆ tolerance

const double QgsGeometryCheckContext::tolerance

The tolerance to allow for in geometry checks.

Will be calculated as pow(10, -precision) in the constructor. I.e. if the precision is 4 (decimal digits), this will be 0.0001.

Definition at line 52 of file qgsgeometrycheckcontext.h.

◆ transformContext

const QgsCoordinateTransformContext QgsGeometryCheckContext::transformContext

The coordinate transform context with which transformations will be done.

Definition at line 70 of file qgsgeometrycheckcontext.h.

◆ uniqueIdFieldIndex

const int QgsGeometryCheckContext::uniqueIdFieldIndex

The index of the unique ID field used to identify features.

Since
QGIS 4.0

Definition at line 77 of file qgsgeometrycheckcontext.h.


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