QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
analysis
vector
geometry_checker
qgsgeometrycheckerror.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsgeometrycheckerror.h
3
--------
4
begin : September 2018
5
copyright : (C) 2018 by Denis Rouzaud
6
email : denis@opengis.ch
7
***************************************************************************/
8
9
/***************************************************************************
10
* *
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
15
* *
16
***************************************************************************/
17
18
#ifndef QGSGEOMETRYCHECKERROR_H
19
#define QGSGEOMETRYCHECKERROR_H
20
21
#include "qgis_analysis.h"
22
#include "
qgsgeometrycheck.h
"
23
#include "
qgsgeometrycheckerutils.h
"
24
25
class
QgsPointXY
;
26
34
class
ANALYSIS_EXPORT
QgsGeometryCheckError
35
{
36
public
:
40
enum
Status
41
{
42
StatusPending
,
43
StatusFixFailed
,
44
StatusFixed
,
45
StatusObsolete
46
};
47
51
enum
ValueType
52
{
53
ValueLength
,
54
ValueArea
,
55
ValueOther
56
};
57
64
QgsGeometryCheckError
(
65
const
QgsGeometryCheck
*check,
66
const
QgsGeometryCheckerUtils::LayerFeature
&layerFeature,
67
const
QgsPointXY
&errorLocation,
68
QgsVertexId
vidx =
QgsVertexId
(),
69
const
QVariant &value = QVariant(),
70
ValueType valueType = ValueOther
71
);
72
73
virtual
~QgsGeometryCheckError
() =
default
;
74
75
const
QgsGeometryCheckError
&
operator=
(
const
QgsGeometryCheckError
& ) =
delete
;
76
80
const
QgsGeometryCheck
*
check
()
const
{
return
mCheck
; }
81
85
const
QString &
layerId
()
const
{
return
mLayerId
; }
86
90
QgsFeatureId
featureId
()
const
{
return
mFeatureId
; }
91
95
QgsGeometry
geometry()
const
;
96
105
virtual
QgsRectangle
contextBoundingBox()
const
;
106
110
virtual
QgsRectangle
affectedAreaBBox()
const
;
111
116
virtual
QString
description
()
const
{
return
mCheck
->description(); }
117
121
const
QgsPointXY
&
location
()
const
{
return
mErrorLocation
; }
122
128
QVariant
value
()
const
{
return
mValue
; }
129
134
ValueType
valueType
()
const
{
return
mValueType
; }
135
140
const
QgsVertexId
&
vidx
()
const
{
return
mVidx
; }
141
145
Status
status
()
const
{
return
mStatus
; }
146
150
QString
resolutionMessage
()
const
{
return
mResolutionMessage
; }
151
156
void
setFixed(
int
method );
157
161
void
setFixFailed(
const
QString &reason );
162
166
void
setObsolete
() {
mStatus
=
StatusObsolete
; }
167
173
virtual
bool
isEqual(
QgsGeometryCheckError
*other )
const
;
174
179
virtual
bool
closeMatch(
QgsGeometryCheckError
*
/*other*/
)
const
;
180
185
virtual
void
update(
const
QgsGeometryCheckError
*other );
186
190
virtual
bool
handleChanges(
const
QgsGeometryCheck::Changes
&changes )
SIP_SKIP
;
191
199
virtual
QMap<QString, QgsFeatureIds> involvedFeatures() const
SIP_SKIP
;
200
206
virtual QIcon icon() const;
207
208
protected:
217
QgsGeometryCheckError
(
218
const
QgsGeometryCheck
*check,
219
const QString &layerId,
220
QgsFeatureId
featureId,
221
const
QgsGeometry
&geometry,
222
const
QgsPointXY
&errorLocation,
223
QgsVertexId
vidx =
QgsVertexId
(),
224
const QVariant &value = QVariant(),
225
ValueType valueType = ValueOther
226
);
227
228
const
QgsGeometryCheck
*
mCheck
=
nullptr
;
229
QString
mLayerId
;
230
QgsFeatureId
mFeatureId
;
231
QgsGeometry
mGeometry
;
232
QgsPointXY
mErrorLocation
;
233
QgsVertexId
mVidx
;
234
QVariant
mValue
;
235
ValueType
mValueType
;
236
Status
mStatus
;
237
QString
mResolutionMessage
;
238
239
private:
240
#ifdef SIP_RUN
241
const
QgsGeometryCheckError
&
operator=
(
const
QgsGeometryCheckError
& );
242
#endif
243
};
244
245
Q_DECLARE_METATYPE
(
QgsGeometryCheckError
* )
246
247
#endif
// QGSGEOMETRYCHECKERROR_H
QgsGeometryCheckError
This represents an error reported by a geometry check.
Definition
qgsgeometrycheckerror.h:35
QgsGeometryCheckError::mValue
QVariant mValue
Definition
qgsgeometrycheckerror.h:234
QgsGeometryCheckError::ValueType
ValueType
Describes the type of an error value.
Definition
qgsgeometrycheckerror.h:52
QgsGeometryCheckError::ValueArea
@ ValueArea
The value is an area.
Definition
qgsgeometrycheckerror.h:54
QgsGeometryCheckError::ValueOther
@ ValueOther
The value if of another type.
Definition
qgsgeometrycheckerror.h:55
QgsGeometryCheckError::ValueLength
@ ValueLength
The value is a length.
Definition
qgsgeometrycheckerror.h:53
QgsGeometryCheckError::mLayerId
QString mLayerId
Definition
qgsgeometrycheckerror.h:229
QgsGeometryCheckError::Status
Status
The status of an error.
Definition
qgsgeometrycheckerror.h:41
QgsGeometryCheckError::StatusPending
@ StatusPending
The error is detected and pending to be handled.
Definition
qgsgeometrycheckerror.h:42
QgsGeometryCheckError::StatusFixed
@ StatusFixed
The error is fixed.
Definition
qgsgeometrycheckerror.h:44
QgsGeometryCheckError::StatusFixFailed
@ StatusFixFailed
A fix has been tried on the error but failed.
Definition
qgsgeometrycheckerror.h:43
QgsGeometryCheckError::StatusObsolete
@ StatusObsolete
The error is obsolete because of other modifications.
Definition
qgsgeometrycheckerror.h:45
QgsGeometryCheckError::status
Status status() const
The status of the error.
Definition
qgsgeometrycheckerror.h:145
QgsGeometryCheckError::resolutionMessage
QString resolutionMessage() const
A message with details, how the error has been resolved.
Definition
qgsgeometrycheckerror.h:150
QgsGeometryCheckError::vidx
const QgsVertexId & vidx() const
The id of the affected vertex.
Definition
qgsgeometrycheckerror.h:140
QgsGeometryCheckError::featureId
QgsFeatureId featureId() const
The id of the feature on which this error has been detected.
Definition
qgsgeometrycheckerror.h:90
QgsGeometryCheckError::~QgsGeometryCheckError
virtual ~QgsGeometryCheckError()=default
QgsGeometryCheckError::mCheck
const QgsGeometryCheck * mCheck
Definition
qgsgeometrycheckerror.h:228
QgsGeometryCheckError::description
virtual QString description() const
The error description.
Definition
qgsgeometrycheckerror.h:116
QgsGeometryCheckError::QgsGeometryCheckError
QgsGeometryCheckError(const QgsGeometryCheck *check, const QgsGeometryCheckerUtils::LayerFeature &layerFeature, const QgsPointXY &errorLocation, QgsVertexId vidx=QgsVertexId(), const QVariant &value=QVariant(), ValueType valueType=ValueOther)
Create a new geometry check error with the parent check and for the layerFeature pair at the errorLoc...
Definition
qgsgeometrycheckerror.cpp:40
QgsGeometryCheckError::mGeometry
QgsGeometry mGeometry
Definition
qgsgeometrycheckerror.h:231
QgsGeometryCheckError::valueType
ValueType valueType() const
The type of the value.
Definition
qgsgeometrycheckerror.h:134
QgsGeometryCheckError::mFeatureId
QgsFeatureId mFeatureId
Definition
qgsgeometrycheckerror.h:230
QgsGeometryCheckError::mErrorLocation
QgsPointXY mErrorLocation
Definition
qgsgeometrycheckerror.h:232
QgsGeometryCheckError::value
QVariant value() const
An additional value for the error.
Definition
qgsgeometrycheckerror.h:128
QgsGeometryCheckError::setObsolete
void setObsolete()
Set the error status to obsolete.
Definition
qgsgeometrycheckerror.h:166
QgsGeometryCheckError::mVidx
QgsVertexId mVidx
Definition
qgsgeometrycheckerror.h:233
QgsGeometryCheckError::check
const QgsGeometryCheck * check() const
The geometry check that created this error.
Definition
qgsgeometrycheckerror.h:80
QgsGeometryCheckError::layerId
const QString & layerId() const
The id of the layer on which this error has been detected.
Definition
qgsgeometrycheckerror.h:85
QgsGeometryCheckError::mValueType
ValueType mValueType
Definition
qgsgeometrycheckerror.h:235
QgsGeometryCheckError::mStatus
Status mStatus
Definition
qgsgeometrycheckerror.h:236
QgsGeometryCheckError::operator=
const QgsGeometryCheckError & operator=(const QgsGeometryCheckError &)=delete
QgsGeometryCheckError::location
const QgsPointXY & location() const
The location of the error in map units.
Definition
qgsgeometrycheckerror.h:121
QgsGeometryCheckError::mResolutionMessage
QString mResolutionMessage
Definition
qgsgeometrycheckerror.h:237
QgsGeometryCheck
Base class for geometry checks.
Definition
qgsgeometrycheck.h:93
QgsGeometryCheck::Changes
QMap< QString, QMap< QgsFeatureId, QList< QgsGeometryCheck::Change > > > Changes
A collection of changes.
Definition
qgsgeometrycheck.h:218
QgsGeometryCheckerUtils::LayerFeature
A layer feature combination to uniquely identify and access a feature in a set of layers.
Definition
qgsgeometrycheckerutils.h:52
QgsGeometry
A geometry is the spatial representation of a feature.
Definition
qgsgeometry.h:267
QgsPointXY
Represents a 2D point.
Definition
qgspointxy.h:62
QgsRectangle
A rectangle specified with double values.
Definition
qgsrectangle.h:47
SIP_SKIP
#define SIP_SKIP
Definition
qgis_sip.h:138
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(QgsDatabaseQueryLogEntry)
QgsFeatureId
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features
Definition
qgsfeatureid.h:32
qgsgeometrycheck.h
qgsgeometrycheckerutils.h
QgsVertexId
Utility class for identifying a unique vertex within a geometry.
Definition
qgsvertexid.h:35
Generated on
for QGIS API Documentation by
1.17.0