Skip to content

Commit

Permalink
Overlap check documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Dec 22, 2018
1 parent 525a3da commit f2d4d87
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions src/analysis/vector/geometry_checker/qgsgeometryoverlapcheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@
#include "qgsgeometrycheck.h"
#include "qgsgeometrycheckerror.h"


/**
* \ingroup analysis
* An error of a QgsGeometryOverlapCheck.
*
* \since QGIS 3.4
*/
class ANALYSIS_EXPORT QgsGeometryOverlapCheckError : public QgsGeometryCheckError
{
public:
Expand All @@ -46,12 +51,22 @@ class ANALYSIS_EXPORT QgsGeometryOverlapCheckError : public QgsGeometryCheckErro
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,
const QgsGeometryCheckerUtils::LayerFeature &layerFeature,
const QgsGeometry &geometry,
const QgsPointXY &errorLocation,
const QVariant &value,
const QgsGeometryCheckerUtils::LayerFeature &overlappedFeature );

/**
* Returns the overlapped feature
*/
const OverlappedFeature &overlappedFeature() const { return mOverlappedFeature; }

bool isEqual( QgsGeometryCheckError *other ) const override
Expand Down Expand Up @@ -90,11 +105,24 @@ class ANALYSIS_EXPORT QgsGeometryOverlapCheckError : public QgsGeometryCheckErro
OverlappedFeature mOverlappedFeature;
};

/**
* \ingroup analysis
* Checks if geometries overlap.
*
* \since QGIS 3.4
*/
class ANALYSIS_EXPORT QgsGeometryOverlapCheck : public QgsGeometryCheck
{
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.
Expand Down

0 comments on commit f2d4d87

Please sign in to comment.