QGIS API Documentation  2.14.0-Essen
Public Member Functions | Static Public Member Functions | List of all members
QgsGeos Class Reference

Does vector analysis using the geos library and handles import, export, exception handling*. More...

#include <qgsgeos.h>

Inheritance diagram for QgsGeos:
Inheritance graph
[legend]

Public Member Functions

 QgsGeos (const QgsAbstractGeometryV2 *geometry, double precision=0)
 GEOS geometry engine constructor. More...
 
 ~QgsGeos ()
 
double area (QString *errorMsg=nullptr) const override
 
QgsAbstractGeometryV2buffer (double distance, int segments, QString *errorMsg=nullptr) const override
 
QgsAbstractGeometryV2buffer (double distance, int segments, int endCapStyle, int joinStyle, double mitreLimit, QString *errorMsg=nullptr) const override
 
bool centroid (QgsPointV2 &pt, QString *errorMsg=nullptr) const override
 
QgsGeometry closestPoint (const QgsGeometry &other, QString *errorMsg=nullptr) const
 Returns the closest point on the geometry to the other geometry. More...
 
QgsAbstractGeometryV2combine (const QgsAbstractGeometryV2 &geom, QString *errorMsg=nullptr) const override
 
QgsAbstractGeometryV2combine (const QList< QgsAbstractGeometryV2 * > &, QString *errorMsg=nullptr) const override
 
bool contains (const QgsAbstractGeometryV2 &geom, QString *errorMsg=nullptr) const override
 
QgsAbstractGeometryV2convexHull (QString *errorMsg=nullptr) const override
 
bool crosses (const QgsAbstractGeometryV2 &geom, QString *errorMsg=nullptr) const override
 
QgsAbstractGeometryV2difference (const QgsAbstractGeometryV2 &geom, QString *errorMsg=nullptr) const override
 
bool disjoint (const QgsAbstractGeometryV2 &geom, QString *errorMsg=nullptr) const override
 
double distance (const QgsAbstractGeometryV2 &geom, QString *errorMsg=nullptr) const override
 
QgsAbstractGeometryV2envelope (QString *errorMsg=nullptr) const override
 
void geometryChanged () override
 Removes caches. More...
 
QgsAbstractGeometryV2interpolate (double distance, QString *errorMsg=nullptr) const override
 
QgsAbstractGeometryV2intersection (const QgsAbstractGeometryV2 &geom, QString *errorMsg=nullptr) const override
 
bool intersects (const QgsAbstractGeometryV2 &geom, QString *errorMsg=nullptr) const override
 
bool isEmpty (QString *errorMsg=nullptr) const override
 
bool isEqual (const QgsAbstractGeometryV2 &geom, QString *errorMsg=nullptr) const override
 
bool isValid (QString *errorMsg=nullptr) const override
 
double length (QString *errorMsg=nullptr) const override
 
QgsAbstractGeometryV2offsetCurve (double distance, int segments, int joinStyle, double mitreLimit, QString *errorMsg=nullptr) const override
 
bool overlaps (const QgsAbstractGeometryV2 &geom, QString *errorMsg=nullptr) const override
 
bool pointOnSurface (QgsPointV2 &pt, QString *errorMsg=nullptr) const override
 
void prepareGeometry () override
 
QString relate (const QgsAbstractGeometryV2 &geom, QString *errorMsg=nullptr) const override
 Returns the Dimensional Extended 9 Intersection Model (DE-9IM) representation of the relationship between the geometries. More...
 
bool relatePattern (const QgsAbstractGeometryV2 &geom, const QString &pattern, QString *errorMsg=nullptr) const override
 Tests whether two geometries are related by a specified Dimensional Extended 9 Intersection Model (DE-9IM) pattern. More...
 
QgsAbstractGeometryV2reshapeGeometry (const QgsLineStringV2 &reshapeWithLine, int *errorCode, QString *errorMsg=nullptr) const
 
QgsGeometry shortestLine (const QgsGeometry &other, QString *errorMsg=nullptr) const
 Returns the shortest line joining this geometry to the other geometry. More...
 
QgsAbstractGeometryV2simplify (double tolerance, QString *errorMsg=nullptr) const override
 
int splitGeometry (const QgsLineStringV2 &splitLine, QList< QgsAbstractGeometryV2 * > &newGeometries, bool topological, QgsPointSequenceV2 &topologyTestPoints, QString *errorMsg=nullptr) const override
 Splits this geometry according to a given line. More...
 
QgsAbstractGeometryV2symDifference (const QgsAbstractGeometryV2 &geom, QString *errorMsg=nullptr) const override
 
bool touches (const QgsAbstractGeometryV2 &geom, QString *errorMsg=nullptr) const override
 
bool within (const QgsAbstractGeometryV2 &geom, QString *errorMsg=nullptr) const override
 
- Public Member Functions inherited from QgsGeometryEngine
 QgsGeometryEngine (const QgsAbstractGeometryV2 *geometry)
 
virtual ~QgsGeometryEngine ()
 

Static Public Member Functions

static GEOSGeometry * asGeos (const QgsAbstractGeometryV2 *geom, double precision=0)
 
static QgsPointV2 coordSeqPoint (const GEOSCoordSequence *cs, int i, bool hasZ, bool hasM)
 
static QgsAbstractGeometryV2fromGeos (const GEOSGeometry *geos)
 Create a geometry from a GEOSGeometry. More...
 
static QgsPolygonV2fromGeosPolygon (const GEOSGeometry *geos)
 
static GEOSContextHandle_t getGEOSHandler ()
 

Additional Inherited Members

- Protected Member Functions inherited from QgsGeometryEngine
 QgsGeometryEngine ()
 
- Protected Attributes inherited from QgsGeometryEngine
const QgsAbstractGeometryV2mGeometry
 

Detailed Description

Does vector analysis using the geos library and handles import, export, exception handling*.

Note
this API is not considered stable and may change for 2.12
not available in Python bindings

Definition at line 31 of file qgsgeos.h.

Constructor & Destructor Documentation

QgsGeos::QgsGeos ( const QgsAbstractGeometryV2 geometry,
double  precision = 0 
)

GEOS geometry engine constructor.

Parameters
geometryThe geometry
precisionThe precision of the grid to which to snap the geometry vertices. If 0, no snapping is performed.

Definition at line 135 of file qgsgeos.cpp.

QgsGeos::~QgsGeos ( )

Definition at line 141 of file qgsgeos.cpp.

Member Function Documentation

double QgsGeos::area ( QString errorMsg = nullptr) const
overridevirtual

Implements QgsGeometryEngine.

Definition at line 345 of file qgsgeos.cpp.

GEOSGeometry * QgsGeos::asGeos ( const QgsAbstractGeometryV2 geom,
double  precision = 0 
)
static

Definition at line 1051 of file qgsgeos.cpp.

QgsAbstractGeometryV2 * QgsGeos::buffer ( double  distance,
int  segments,
QString errorMsg = nullptr 
) const
overridevirtual

Implements QgsGeometryEngine.

Definition at line 1263 of file qgsgeos.cpp.

QgsAbstractGeometryV2 * QgsGeos::buffer ( double  distance,
int  segments,
int  endCapStyle,
int  joinStyle,
double  mitreLimit,
QString errorMsg = nullptr 
) const
overridevirtual

Implements QgsGeometryEngine.

Definition at line 1279 of file qgsgeos.cpp.

bool QgsGeos::centroid ( QgsPointV2 pt,
QString errorMsg = nullptr 
) const
overridevirtual

Implements QgsGeometryEngine.

Definition at line 1331 of file qgsgeos.cpp.

QgsGeometry QgsGeos::closestPoint ( const QgsGeometry other,
QString errorMsg = nullptr 
) const

Returns the closest point on the geometry to the other geometry.

Note
added in QGIS 2.14
See also
shortestLine()

Definition at line 1776 of file qgsgeos.cpp.

QgsAbstractGeometryV2 * QgsGeos::combine ( const QgsAbstractGeometryV2 geom,
QString errorMsg = nullptr 
) const
overridevirtual

Implements QgsGeometryEngine.

Definition at line 188 of file qgsgeos.cpp.

QgsAbstractGeometryV2 * QgsGeos::combine ( const QList< QgsAbstractGeometryV2 * > &  geomList,
QString errorMsg = nullptr 
) const
overridevirtual

Implements QgsGeometryEngine.

Definition at line 193 of file qgsgeos.cpp.

bool QgsGeos::contains ( const QgsAbstractGeometryV2 geom,
QString errorMsg = nullptr 
) const
overridevirtual

Implements QgsGeometryEngine.

Definition at line 272 of file qgsgeos.cpp.

QgsAbstractGeometryV2 * QgsGeos::convexHull ( QString errorMsg = nullptr) const
overridevirtual

Implements QgsGeometryEngine.

Definition at line 1402 of file qgsgeos.cpp.

QgsPointV2 QgsGeos::coordSeqPoint ( const GEOSCoordSequence *  cs,
int  i,
bool  hasZ,
bool  hasM 
)
static

Definition at line 1014 of file qgsgeos.cpp.

bool QgsGeos::crosses ( const QgsAbstractGeometryV2 geom,
QString errorMsg = nullptr 
) const
overridevirtual

Implements QgsGeometryEngine.

Definition at line 257 of file qgsgeos.cpp.

QgsAbstractGeometryV2 * QgsGeos::difference ( const QgsAbstractGeometryV2 geom,
QString errorMsg = nullptr 
) const
overridevirtual

Implements QgsGeometryEngine.

Definition at line 183 of file qgsgeos.cpp.

bool QgsGeos::disjoint ( const QgsAbstractGeometryV2 geom,
QString errorMsg = nullptr 
) const
overridevirtual

Implements QgsGeometryEngine.

Definition at line 277 of file qgsgeos.cpp.

double QgsGeos::distance ( const QgsAbstractGeometryV2 geom,
QString errorMsg = nullptr 
) const
overridevirtual

Implements QgsGeometryEngine.

Definition at line 222 of file qgsgeos.cpp.

QgsAbstractGeometryV2 * QgsGeos::envelope ( QString errorMsg = nullptr) const
overridevirtual

Implements QgsGeometryEngine.

Definition at line 1358 of file qgsgeos.cpp.

QgsAbstractGeometryV2 * QgsGeos::fromGeos ( const GEOSGeometry *  geos)
static

Create a geometry from a GEOSGeometry.

Parameters
geosGEOSGeometry. Ownership is NOT transferred.

Definition at line 862 of file qgsgeos.cpp.

QgsPolygonV2 * QgsGeos::fromGeosPolygon ( const GEOSGeometry *  geos)
static

Definition at line 950 of file qgsgeos.cpp.

void QgsGeos::geometryChanged ( )
overridevirtual

Removes caches.

Implements QgsGeometryEngine.

Definition at line 149 of file qgsgeos.cpp.

GEOSContextHandle_t QgsGeos::getGEOSHandler ( )
static

Definition at line 2285 of file qgsgeos.cpp.

QgsAbstractGeometryV2 * QgsGeos::interpolate ( double  distance,
QString errorMsg = nullptr 
) const
overridevirtual

Implements QgsGeometryEngine.

Definition at line 1316 of file qgsgeos.cpp.

QgsAbstractGeometryV2 * QgsGeos::intersection ( const QgsAbstractGeometryV2 geom,
QString errorMsg = nullptr 
) const
overridevirtual

Implements QgsGeometryEngine.

Definition at line 178 of file qgsgeos.cpp.

bool QgsGeos::intersects ( const QgsAbstractGeometryV2 geom,
QString errorMsg = nullptr 
) const
overridevirtual

Implements QgsGeometryEngine.

Definition at line 247 of file qgsgeos.cpp.

bool QgsGeos::isEmpty ( QString errorMsg = nullptr) const
overridevirtual

Implements QgsGeometryEngine.

Definition at line 1453 of file qgsgeos.cpp.

bool QgsGeos::isEqual ( const QgsAbstractGeometryV2 geom,
QString errorMsg = nullptr 
) const
overridevirtual

Implements QgsGeometryEngine.

Definition at line 1433 of file qgsgeos.cpp.

bool QgsGeos::isValid ( QString errorMsg = nullptr) const
overridevirtual

Implements QgsGeometryEngine.

Definition at line 1419 of file qgsgeos.cpp.

double QgsGeos::length ( QString errorMsg = nullptr) const
overridevirtual

Implements QgsGeometryEngine.

Definition at line 362 of file qgsgeos.cpp.

QgsAbstractGeometryV2 * QgsGeos::offsetCurve ( double  distance,
int  segments,
int  joinStyle,
double  mitreLimit,
QString errorMsg = nullptr 
) const
overridevirtual

Implements QgsGeometryEngine.

Definition at line 1652 of file qgsgeos.cpp.

bool QgsGeos::overlaps ( const QgsAbstractGeometryV2 geom,
QString errorMsg = nullptr 
) const
overridevirtual

Implements QgsGeometryEngine.

Definition at line 267 of file qgsgeos.cpp.

bool QgsGeos::pointOnSurface ( QgsPointV2 pt,
QString errorMsg = nullptr 
) const
overridevirtual

Implements QgsGeometryEngine.

Definition at line 1373 of file qgsgeos.cpp.

void QgsGeos::prepareGeometry ( )
overridevirtual

Implements QgsGeometryEngine.

Definition at line 158 of file qgsgeos.cpp.

QString QgsGeos::relate ( const QgsAbstractGeometryV2 geom,
QString errorMsg = nullptr 
) const
overridevirtual

Returns the Dimensional Extended 9 Intersection Model (DE-9IM) representation of the relationship between the geometries.

Parameters
geomgeometry to relate to
errorMsgdestination storage for any error message
Returns
DE-9IM string for relationship, or an empty string if an error occurred
Note
added in QGIS 2.12

Implements QgsGeometryEngine.

Definition at line 282 of file qgsgeos.cpp.

bool QgsGeos::relatePattern ( const QgsAbstractGeometryV2 geom,
const QString pattern,
QString errorMsg = nullptr 
) const
overridevirtual

Tests whether two geometries are related by a specified Dimensional Extended 9 Intersection Model (DE-9IM) pattern.

Parameters
geomgeometry to relate to
patternDE-9IM pattern for match
errorMsgdestination storage for any error message
Returns
true if geometry relationship matches with pattern
Note
added in QGIS 2.14

Implements QgsGeometryEngine.

Definition at line 316 of file qgsgeos.cpp.

QgsAbstractGeometryV2 * QgsGeos::reshapeGeometry ( const QgsLineStringV2 reshapeWithLine,
int *  errorCode,
QString errorMsg = nullptr 
) const

Definition at line 1668 of file qgsgeos.cpp.

QgsGeometry QgsGeos::shortestLine ( const QgsGeometry other,
QString errorMsg = nullptr 
) const

Returns the shortest line joining this geometry to the other geometry.

Note
added in QGIS 2.14
See also
closestPoint()

Definition at line 1811 of file qgsgeos.cpp.

QgsAbstractGeometryV2 * QgsGeos::simplify ( double  tolerance,
QString errorMsg = nullptr 
) const
overridevirtual

Implements QgsGeometryEngine.

Definition at line 1301 of file qgsgeos.cpp.

int QgsGeos::splitGeometry ( const QgsLineStringV2 splitLine,
QList< QgsAbstractGeometryV2 * > &  newGeometries,
bool  topological,
QgsPointSequenceV2 topologyTestPoints,
QString errorMsg = nullptr 
) const
overridevirtual

Splits this geometry according to a given line.

Parameters
splitLinethe line that splits the geometry
[out]newGeometrieslist of new geometries that have been created with the split
topologicaltrue if topological editing is enabled
[out]topologyTestPointspoints that need to be tested for topological completeness in the dataset
[out]errorMsgerror messages emitted, if any
Returns
0 in case of success, 1 if geometry has not been split, error else

Reimplemented from QgsGeometryEngine.

Definition at line 378 of file qgsgeos.cpp.

QgsAbstractGeometryV2 * QgsGeos::symDifference ( const QgsAbstractGeometryV2 geom,
QString errorMsg = nullptr 
) const
overridevirtual

Implements QgsGeometryEngine.

Definition at line 217 of file qgsgeos.cpp.

bool QgsGeos::touches ( const QgsAbstractGeometryV2 geom,
QString errorMsg = nullptr 
) const
overridevirtual

Implements QgsGeometryEngine.

Definition at line 252 of file qgsgeos.cpp.

bool QgsGeos::within ( const QgsAbstractGeometryV2 geom,
QString errorMsg = nullptr 
) const
overridevirtual

Implements QgsGeometryEngine.

Definition at line 262 of file qgsgeos.cpp.


The documentation for this class was generated from the following files: