55 void CORE_EXPORT
operator()(
const GEOSPreparedGeometry *geom )
const;
61 void CORE_EXPORT
operator()( GEOSBufferParams *params )
const;
67 void CORE_EXPORT
operator()( GEOSCoordSequence *sequence )
const;
73 using unique_ptr = std::unique_ptr< GEOSGeometry, GeosDeleter>;
147 std::unique_ptr< QgsAbstractGeometry > clip(
const QgsRectangle &rectangle, QString *errorMsg =
nullptr )
const;
190 bool contains(
double x,
double y, QString *errorMsg =
nullptr )
const;
199 double distance(
double x,
double y, QString *errorMsg =
nullptr )
const;
215 double hausdorffDistance(
const QgsAbstractGeometry *geom, QString *errorMsg =
nullptr )
const;
232 double hausdorffDistanceDensify(
const QgsAbstractGeometry *geom,
double densifyFraction, QString *errorMsg =
nullptr )
const;
246 double frechetDistance(
const QgsAbstractGeometry *geom, QString *errorMsg =
nullptr )
const;
270 double frechetDistanceDensify(
const QgsAbstractGeometry *geom,
double densifyFraction, QString *errorMsg =
nullptr )
const;
281 double area( QString *errorMsg =
nullptr )
const override;
282 double length( QString *errorMsg =
nullptr )
const override;
283 bool isValid( QString *errorMsg =
nullptr,
bool allowSelfTouchingHoles =
false,
QgsGeometry *errorLoc =
nullptr )
const override;
285 bool isEmpty( QString *errorMsg =
nullptr )
const override;
286 bool isSimple( QString *errorMsg =
nullptr )
const override;
289 QVector<QgsGeometry> &newGeometries,
292 QString *errorMsg =
nullptr,
bool skipIntersectionCheck =
false )
const override;
308 std::unique_ptr< QgsAbstractGeometry > singleSidedBuffer(
double distance,
int segments,
Qgis::BufferSide side,
310 QString *errorMsg =
nullptr )
const;
336 std::unique_ptr< QgsAbstractGeometry > maximumInscribedCircle(
double tolerance, QString *errorMsg =
nullptr )
const;
361 std::unique_ptr< QgsAbstractGeometry > largestEmptyCircle(
double tolerance,
const QgsAbstractGeometry *boundary =
nullptr, QString *errorMsg =
nullptr )
const;
377 std::unique_ptr< QgsAbstractGeometry > minimumWidth( QString *errorMsg =
nullptr )
const;
400 double minimumClearance( QString *errorMsg =
nullptr )
const;
413 std::unique_ptr< QgsAbstractGeometry > minimumClearanceLine( QString *errorMsg =
nullptr )
const;
425 std::unique_ptr< QgsAbstractGeometry > node( QString *errorMsg =
nullptr )
const;
441 std::unique_ptr< QgsAbstractGeometry > sharedPaths(
const QgsAbstractGeometry *other, QString *errorMsg =
nullptr )
const;
460 QgsGeometry mergeLines( QString *errorMsg =
nullptr )
const;
491 double lineLocatePoint(
const QgsPoint &point, QString *errorMsg =
nullptr )
const;
505 double lineLocatePoint(
double x,
double y, QString *errorMsg =
nullptr )
const;
515 static QgsGeometry polygonize(
const QVector<const QgsAbstractGeometry *> &geometries, QString *errorMsg =
nullptr );
531 QgsGeometry voronoiDiagram(
const QgsAbstractGeometry *extent =
nullptr,
double tolerance = 0.0,
bool edgesOnly =
false, QString *errorMsg =
nullptr )
const;
542 QgsGeometry delaunayTriangulation(
double tolerance = 0.0,
bool edgesOnly =
false, QString *errorMsg =
nullptr )
const;
556 std::unique_ptr< QgsAbstractGeometry > constrainedDelaunayTriangulation( QString *errorMsg =
nullptr )
const;
579 QgsAbstractGeometry *concaveHull(
double targetPercent,
bool allowHoles =
false, QString *errorMsg =
nullptr )
const;
600 Qgis::CoverageValidityResult validateCoverage(
double gapWidth, std::unique_ptr< QgsAbstractGeometry > *invalidEdges, QString *errorMsg =
nullptr )
const;
623 std::unique_ptr< QgsAbstractGeometry > simplifyCoverageVW(
double tolerance,
bool preserveBoundary, QString *errorMsg =
nullptr )
const;
636 std::unique_ptr< QgsAbstractGeometry > unionCoverage( QString *errorMsg =
nullptr )
const;
642 static std::unique_ptr< QgsAbstractGeometry > fromGeos(
const GEOSGeometry *
geos );
643 static std::unique_ptr< QgsPolygon > fromGeosPolygon(
const GEOSGeometry *
geos );
659 static QgsPoint coordSeqPoint(
const GEOSCoordSequence *cs,
int i,
bool hasZ,
bool hasM );
661 static GEOSContextHandle_t getGEOSHandler();
667 double mPrecision = 0.0;
689 void cacheGeos()
const;
699 bool relation(
const QgsAbstractGeometry *geom, Relation r, QString *errorMsg =
nullptr )
const;
700 static GEOSCoordSequence *createCoordinateSequence(
const QgsCurve *curve,
double precision,
bool forceClose =
false );
701 static std::unique_ptr< QgsLineString > sequenceToLinestring(
const GEOSGeometry *
geos,
bool hasZ,
bool hasM );
704 int mergeGeometriesMultiTypeSplit( QVector<GEOSGeometry *> &splitResult )
const;
709 static geos::unique_ptr createGeosCollection(
int typeId,
const QVector<GEOSGeometry *> &geoms );
711 static geos::unique_ptr createGeosPointXY(
double x,
double y,
bool hasZ,
double z,
bool hasM,
double m,
int coordDims,
double precision );
734class GEOSException :
public std::runtime_error
737 explicit GEOSException(
const QString &message )
738 : std::runtime_error( message.toUtf8().constData() )
BufferSide
Side of line to buffer.
GeometryOperationResult
Success or failure of a geometry operation.
JoinStyle
Join styles for buffers.
EndCapStyle
End cap styles for buffers.
CoverageValidityResult
Coverage validity results.
MakeValidMethod
Algorithms to use when repairing invalid geometries.
@ Linework
Combines all rings into a set of noded lines and then extracts valid polygons from that linework.
Abstract base class for all geometries.
Abstract base class for curved geometry type.
A geometry engine is a low-level representation of a QgsAbstractGeometry object, optimised for use wi...
virtual bool isEqual(const QgsAbstractGeometry *geom, QString *errorMsg=nullptr) const =0
Checks if this is equal to geom.
virtual double area(QString *errorMsg=nullptr) const =0
virtual QgsGeometryEngine::EngineOperationResult splitGeometry(const QgsLineString &splitLine, QVector< QgsGeometry > &newGeometries, bool topological, QgsPointSequence &topologyTestPoints, QString *errorMsg=nullptr, bool skipIntersectionCheck=false) const
Splits this geometry according to a given line.
virtual void geometryChanged()=0
Should be called whenever the geometry associated with the engine has been modified and the engine mu...
virtual bool intersects(const QgsAbstractGeometry *geom, QString *errorMsg=nullptr) const =0
Checks if geom intersects this.
virtual QgsAbstractGeometry * symDifference(const QgsAbstractGeometry *geom, QString *errorMsg=nullptr, const QgsGeometryParameters ¶meters=QgsGeometryParameters()) const =0
Calculate the symmetric difference of this and geom.
virtual QgsAbstractGeometry * buffer(double distance, int segments, QString *errorMsg=nullptr) const =0
virtual QgsAbstractGeometry * offsetCurve(double distance, int segments, Qgis::JoinStyle joinStyle, double miterLimit, QString *errorMsg=nullptr) const =0
Offsets a curve.
virtual double distance(const QgsAbstractGeometry *geom, QString *errorMsg=nullptr) const =0
Calculates the distance between this and geom.
virtual QgsAbstractGeometry * intersection(const QgsAbstractGeometry *geom, QString *errorMsg=nullptr, const QgsGeometryParameters ¶meters=QgsGeometryParameters()) const =0
Calculate the intersection of this and geom.
virtual bool distanceWithin(const QgsAbstractGeometry *geom, double maxdistance, QString *errorMsg=nullptr) const =0
Checks if geom is within maxdistance distance from this geometry.
virtual QgsAbstractGeometry * interpolate(double distance, QString *errorMsg=nullptr) const =0
virtual QgsAbstractGeometry * simplify(double tolerance, QString *errorMsg=nullptr) const =0
virtual bool isValid(QString *errorMsg=nullptr, bool allowSelfTouchingHoles=false, QgsGeometry *errorLoc=nullptr) const =0
Returns true if the geometry is valid.
virtual QgsPoint * pointOnSurface(QString *errorMsg=nullptr) const =0
Calculate a point that is guaranteed to be on the surface of this.
virtual bool touches(const QgsAbstractGeometry *geom, QString *errorMsg=nullptr) const =0
Checks if geom touches this.
virtual QgsAbstractGeometry * envelope(QString *errorMsg=nullptr) const =0
EngineOperationResult
Success or failure of a geometry operation.
virtual bool isEmpty(QString *errorMsg) const =0
virtual bool crosses(const QgsAbstractGeometry *geom, QString *errorMsg=nullptr) const =0
Checks if geom crosses this.
virtual QgsAbstractGeometry * difference(const QgsAbstractGeometry *geom, QString *errorMsg=nullptr, const QgsGeometryParameters ¶meters=QgsGeometryParameters()) const =0
Calculate the difference of this and geom.
virtual QString relate(const QgsAbstractGeometry *geom, QString *errorMsg=nullptr) const =0
Returns the Dimensional Extended 9 Intersection Model (DE-9IM) representation of the relationship bet...
virtual bool relatePattern(const QgsAbstractGeometry *geom, const QString &pattern, QString *errorMsg=nullptr) const =0
Tests whether two geometries are related by a specified Dimensional Extended 9 Intersection Model (DE...
virtual bool isSimple(QString *errorMsg=nullptr) const =0
Determines whether the geometry is simple (according to OGC definition).
virtual QgsAbstractGeometry * convexHull(QString *errorMsg=nullptr) const =0
Calculate the convex hull of this.
virtual QgsAbstractGeometry * combine(const QgsAbstractGeometry *geom, QString *errorMsg=nullptr, const QgsGeometryParameters ¶meters=QgsGeometryParameters()) const =0
Calculate the combination of this and geom.
virtual bool overlaps(const QgsAbstractGeometry *geom, QString *errorMsg=nullptr) const =0
Checks if geom overlaps this.
virtual bool within(const QgsAbstractGeometry *geom, QString *errorMsg=nullptr) const =0
Checks if geom is within this.
virtual void prepareGeometry()=0
Prepares the geometry, so that subsequent calls to spatial relation methods are much faster.
virtual bool contains(const QgsAbstractGeometry *geom, QString *errorMsg=nullptr) const =0
Checks if geom contains this.
virtual double length(QString *errorMsg=nullptr) const =0
virtual QgsPoint * centroid(QString *errorMsg=nullptr) const =0
Calculates the centroid of this.
virtual bool disjoint(const QgsAbstractGeometry *geom, QString *errorMsg=nullptr) const =0
Checks if geom is disjoint from this.
Encapsulates parameters under which a geometry operation is performed.
A geometry is the spatial representation of a feature.
Does vector analysis using the geos library and handles import, export, exception handling*.
Line string geometry type, with support for z-dimension and m-values.
Point geometry type, with support for z-dimension and m-values.
A rectangle specified with double values.
Contains geos related utilities and functions.
std::unique_ptr< const GEOSPreparedGeometry, GeosDeleter > prepared_unique_ptr
Scoped GEOS prepared geometry pointer.
std::unique_ptr< GEOSGeometry, GeosDeleter > unique_ptr
Scoped GEOS pointer.
std::unique_ptr< GEOSCoordSequence, GeosDeleter > coord_sequence_unique_ptr
Scoped GEOS coordinate sequence pointer.
std::unique_ptr< GEOSBufferParams, GeosDeleter > buffer_params_unique_ptr
Scoped GEOS buffer params pointer.
QVector< QgsPoint > QgsPointSequence
Destroys the GEOS geometry geom, using the static QGIS geos context.
void CORE_EXPORT operator()(GEOSGeometry *geom) const
Destroys the GEOS geometry geom, using the static QGIS geos context.
void CORE_EXPORT operator()(GEOSBufferParams *params) const
Destroys the GEOS buffer params params, using the static QGIS geos context.
void CORE_EXPORT operator()(GEOSCoordSequence *sequence) const
Destroys the GEOS coordinate sequence sequence, using the static QGIS geos context.
void CORE_EXPORT operator()(const GEOSPreparedGeometry *geom) const
Destroys the GEOS prepared geometry geom, using the static QGIS geos context.
struct GEOSGeom_t GEOSGeometry