QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
w
z
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
w
z
Variables
Typedefs
Enumerations
Enumerator
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
2
3
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
2
3
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
c
e
f
g
h
k
l
m
o
p
r
s
t
u
v
w
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Related Functions
3
a
c
d
e
f
g
i
l
m
n
o
p
q
r
s
t
v
Files
File List
File Members
All
3
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
z
Variables
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
w
Typedefs
3
a
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
Enumerator
c
l
s
t
Macros
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
w
y
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
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 <QThread>
22
#include "
qgsgeometry.h
"
23
28
class
CORE_EXPORT
QgsGeometryValidator
:
public
QThread
29
{
30
Q_OBJECT
31
32
public
:
33
37
QgsGeometryValidator
(
const
QgsGeometry
&geometry, QVector<QgsGeometry::Error> *errors =
nullptr
,
QgsGeometry::ValidationMethod
method =
QgsGeometry::ValidatorQgisInternal
);
38
~
QgsGeometryValidator
()
override
;
39
40
void
run()
override
;
41
void
stop();
42
47
static
void
validateGeometry(
const
QgsGeometry
&geometry, QVector<QgsGeometry::Error> &errors
SIP_OUT
,
QgsGeometry::ValidationMethod
method =
QgsGeometry::ValidatorQgisInternal
);
48
49
signals:
50
56
void
errorFound
(
const
QgsGeometry::Error
&error );
57
67
void
validationFinished
(
const
QString &summary );
68
69
public
slots:
70
void
addError(
const
QgsGeometry::Error
& );
71
72
private
:
73
void
validatePolyline(
int
i,
const
QgsLineString
*line,
bool
ring =
false
);
74
void
validatePolygon(
int
i,
const
QgsPolygon
*polygon );
75
void
checkRingIntersections(
int
p0,
int
i0,
const
QgsLineString
*ring0,
int
p1,
int
i1,
const
QgsLineString
*ring1 );
76
double
distLine2Point(
double
px,
double
py,
QgsVector
v,
double
qX,
double
qY );
77
bool
intersectLines(
double
px,
double
py,
QgsVector
v,
double
qx,
double
qy,
QgsVector
w,
double
&sX,
double
&sY );
78
bool
ringInRing(
const
QgsLineString
*inside,
const
QgsLineString
*outside );
79
bool
pointInRing(
const
QgsLineString
*ring,
double
pX,
double
pY );
80
81
QgsGeometry
mGeometry;
82
QVector<QgsGeometry::Error> *mErrors;
83
bool
mStop;
84
int
mErrorCount;
85
QgsGeometry::ValidationMethod
mMethod =
QgsGeometry::ValidatorQgisInternal
;
86
};
87
88
#endif
QgsGeometryValidator::validationFinished
void validationFinished(const QString &summary)
Sent when the validation is finished.
QgsPolygon
Polygon geometry type.
Definition:
qgspolygon.h:34
SIP_OUT
#define SIP_OUT
Definition:
qgis_sip.h:58
QgsGeometry::Error
Definition:
qgsgeometry.h:2059
QgsLineString
Line string geometry type, with support for z-dimension and m-values.
Definition:
qgslinestring.h:44
QgsGeometry::ValidatorQgisInternal
@ ValidatorQgisInternal
Use internal QgsGeometryValidator method.
Definition:
qgsgeometry.h:2114
qgis_sip.h
qgsgeometry.h
QgsGeometry
A geometry is the spatial representation of a feature.
Definition:
qgsgeometry.h:124
QgsVector
A class to represent a vector.
Definition:
qgsvector.h:30
QgsGeometry::ValidationMethod
ValidationMethod
Available methods for validating geometries.
Definition:
qgsgeometry.h:2113
QgsGeometryValidator
Definition:
qgsgeometryvalidator.h:29
QgsGeometryValidator::errorFound
void errorFound(const QgsGeometry::Error &error)
Sent when an error has been found during the validation process.
Generated on Sat Oct 24 2020 17:43:09 for QGIS API Documentation by
1.8.20