QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
qgsgeometryvalidator.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsgeometryvalidator.h - geometry validation thread
3
-------------------------------------------------------------------
4
Date : 03.01.2012
5
Copyright : (C) 2012 by Juergen E. Fischer
6
email : jef at norbit dot de
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
#ifndef QGSGEOMETRYVALIDATOR_H
17
#define QGSGEOMETRYVALIDATOR_H
18
19
#include "qgis_core.h"
20
#include "
qgis_sip.h
"
21
#include "
qgsgeometry.h
"
22
23
#include <QThread>
24
25
class
QgsCurvePolygon
;
26
32
class
CORE_EXPORT
QgsGeometryValidator
:
public
QThread
33
{
34
Q_OBJECT
35
36
public
:
40
QgsGeometryValidator
(
const
QgsGeometry
&geometry, QVector<QgsGeometry::Error> *errors =
nullptr
,
Qgis::GeometryValidationEngine
method =
Qgis::GeometryValidationEngine::QgisInternal
);
41
~QgsGeometryValidator
()
override
;
42
43
void
run
()
override
;
44
void
stop
();
45
50
static
void
validateGeometry
(
const
QgsGeometry
&geometry, QVector<QgsGeometry::Error> &errors
SIP_OUT
,
Qgis::GeometryValidationEngine
method =
Qgis::GeometryValidationEngine::QgisInternal
);
51
58
static
Qgis::GeometryValidationEngine
defaultValidationEngine
();
59
60
signals:
61
67
void
errorFound
(
const
QgsGeometry::Error
&error );
68
78
void
validationFinished
(
const
QString &summary );
79
80
public
slots:
81
void
addError
(
const
QgsGeometry::Error
& );
82
83
private
:
84
void
validatePolyline(
int
i,
const
QgsLineString
*line,
bool
ring =
false
);
85
void
validatePolygon(
int
partIndex,
const
QgsCurvePolygon
*polygon );
86
void
checkRingIntersections(
int
partIndex0,
int
ringIndex0,
const
QgsCurve
*ring0,
int
partIndex1,
int
ringIndex1,
const
QgsCurve
*ring1 );
87
double
distLine2Point(
double
px,
double
py,
QgsVector
v,
double
qX,
double
qY );
88
bool
intersectLines(
double
px,
double
py,
QgsVector
v,
double
qx,
double
qy,
QgsVector
w,
double
&sX,
double
&sY );
89
bool
ringInRing(
const
QgsCurve
*inside,
const
QgsCurve
*outside );
90
bool
pointInRing(
const
QgsCurve
*ring,
double
pX,
double
pY );
91
92
QgsGeometry
mGeometry;
93
QVector<QgsGeometry::Error> *mErrors;
94
bool
mStop =
false
;
95
int
mErrorCount = 0;
96
Qgis::GeometryValidationEngine
mMethod =
Qgis::GeometryValidationEngine::QgisInternal
;
97
};
98
99
#endif
Qgis::GeometryValidationEngine
GeometryValidationEngine
Available engines for validating geometries.
Definition
qgis.h:2255
Qgis::GeometryValidationEngine::QgisInternal
@ QgisInternal
Use internal QgsGeometryValidator method.
Definition
qgis.h:2256
QgsCurvePolygon
Curve polygon geometry type.
Definition
qgscurvepolygon.h:41
QgsCurve
Abstract base class for curved geometry type.
Definition
qgscurve.h:36
QgsGeometryValidator::stop
void stop()
Definition
qgsgeometryvalidator.cpp:51
QgsGeometryValidator::validationFinished
void validationFinished(const QString &summary)
Sent when the validation is finished.
QgsGeometryValidator::errorFound
void errorFound(const QgsGeometry::Error &error)
Sent when an error has been found during the validation process.
QgsGeometryValidator::QgsGeometryValidator
QgsGeometryValidator(const QgsGeometry &geometry, QVector< QgsGeometry::Error > *errors=nullptr, Qgis::GeometryValidationEngine method=Qgis::GeometryValidationEngine::QgisInternal)
Constructor for QgsGeometryValidator.
Definition
qgsgeometryvalidator.cpp:39
QgsGeometryValidator::run
void run() override
Definition
qgsgeometryvalidator.cpp:266
QgsGeometryValidator::validateGeometry
static void validateGeometry(const QgsGeometry &geometry, QVector< QgsGeometry::Error > &errors, Qgis::GeometryValidationEngine method=Qgis::GeometryValidationEngine::QgisInternal)
Validate geometry and produce a list of geometry errors.
Definition
qgsgeometryvalidator.cpp:445
QgsGeometryValidator::addError
void addError(const QgsGeometry::Error &)
Definition
qgsgeometryvalidator.cpp:439
QgsGeometryValidator::defaultValidationEngine
static Qgis::GeometryValidationEngine defaultValidationEngine()
Returns the geometry validation engine configured in the application settings.
Definition
qgsgeometryvalidator.cpp:530
QgsGeometry::Error
A geometry error.
Definition
qgsgeometry.h:3069
QgsGeometry
A geometry is the spatial representation of a feature.
Definition
qgsgeometry.h:267
QgsLineString
Line string geometry type, with support for z-dimension and m-values.
Definition
qgslinestring.h:49
QgsVector
Represent a 2-dimensional vector.
Definition
qgsvector.h:34
qgis_sip.h
SIP_OUT
#define SIP_OUT
Definition
qgis_sip.h:57
qgsgeometry.h
Generated on
for QGIS API Documentation by
1.17.0