Overlap check documentation

This commit is contained in:
Matthias Kuhn 2018-12-22 11:04:13 +01:00
parent 525a3da3ab
commit f2d4d877ec
No known key found for this signature in database
GPG Key ID: A0E766808764D73F

View File

@ -21,7 +21,12 @@
#include "qgsgeometrycheck.h" #include "qgsgeometrycheck.h"
#include "qgsgeometrycheckerror.h" #include "qgsgeometrycheckerror.h"
/**
* \ingroup analysis
* An error of a QgsGeometryOverlapCheck.
*
* \since QGIS 3.4
*/
class ANALYSIS_EXPORT QgsGeometryOverlapCheckError : public QgsGeometryCheckError class ANALYSIS_EXPORT QgsGeometryOverlapCheckError : public QgsGeometryCheckError
{ {
public: public:
@ -46,12 +51,22 @@ class ANALYSIS_EXPORT QgsGeometryOverlapCheckError : public QgsGeometryCheckErro
QgsFeatureId mFeatureId; QgsFeatureId mFeatureId;
}; };
/**
* Creates a new overlap check error for \a check and the \a layerFeature combination.
* The \a geometry and \a errorLocation ned to be in map coordinates.
* The \a value is the area of the overlapping area in map units.
* The \a overlappedFeature provides more details about the overlap.
*/
QgsGeometryOverlapCheckError( const QgsGeometryCheck *check, QgsGeometryOverlapCheckError( const QgsGeometryCheck *check,
const QgsGeometryCheckerUtils::LayerFeature &layerFeature, const QgsGeometryCheckerUtils::LayerFeature &layerFeature,
const QgsGeometry &geometry, const QgsGeometry &geometry,
const QgsPointXY &errorLocation, const QgsPointXY &errorLocation,
const QVariant &value, const QVariant &value,
const QgsGeometryCheckerUtils::LayerFeature &overlappedFeature ); const QgsGeometryCheckerUtils::LayerFeature &overlappedFeature );
/**
* Returns the overlapped feature
*/
const OverlappedFeature &overlappedFeature() const { return mOverlappedFeature; } const OverlappedFeature &overlappedFeature() const { return mOverlappedFeature; }
bool isEqual( QgsGeometryCheckError *other ) const override bool isEqual( QgsGeometryCheckError *other ) const override
@ -90,11 +105,24 @@ class ANALYSIS_EXPORT QgsGeometryOverlapCheckError : public QgsGeometryCheckErro
OverlappedFeature mOverlappedFeature; OverlappedFeature mOverlappedFeature;
}; };
/**
* \ingroup analysis
* Checks if geometries overlap.
*
* \since QGIS 3.4
*/
class ANALYSIS_EXPORT QgsGeometryOverlapCheck : public QgsGeometryCheck class ANALYSIS_EXPORT QgsGeometryOverlapCheck : public QgsGeometryCheck
{ {
public: public:
enum ResolutionMethod { Subtract, NoChange }; /**
* Available resolution methods.
*/
enum ResolutionMethod
{
Subtract, //!< Subtract the overlap region from the polygon
NoChange //!< Do not change anything
};
/** /**
* Checks for overlapping polygons. * Checks for overlapping polygons.