QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
Classes | Macros | Functions
qgsgeos.cpp File Reference
#include "qgsgeos.h"
#include "qgsabstractgeometryv2.h"
#include "qgsgeometrycollectionv2.h"
#include "qgsgeometryfactory.h"
#include "qgslinestringv2.h"
#include "qgsmessagelog.h"
#include "qgsmulticurvev2.h"
#include "qgsmultilinestringv2.h"
#include "qgsmultipointv2.h"
#include "qgsmultipolygonv2.h"
#include "qgslogger.h"
#include "qgspolygonv2.h"
#include <limits>
#include <cstdio>
#include <QtCore/qmath.h>
Include dependency graph for qgsgeos.cpp:

Go to the source code of this file.

Classes

class  GEOSGeomScopedPtr
 Scoped GEOS pointer. More...
 

Macros

#define CATCH_GEOS(r)
 
#define CATCH_GEOS_WITH_ERRMSG(r)
 
#define DEFAULT_QUADRANT_SEGMENTS   8
 

Functions

static bool _linestringEndpoints (const GEOSGeometry *linestring, double &x1, double &y1, double &x2, double &y2)
 Extract coordinates of linestring's endpoints. More...
 
static GEOSGeometry * _mergeLinestrings (const GEOSGeometry *line1, const GEOSGeometry *line2, const QgsPoint &interesectionPoint)
 Merge two linestrings if they meet at the given intersection point, return new geometry or null on error. More...
 

Macro Definition Documentation

◆ CATCH_GEOS

#define CATCH_GEOS (   r)
Value:
catch (GEOSException &e) \
{ \
QgsMessageLog::logMessage( QObject::tr( "Exception: %1" ).arg( e.what() ), QObject::tr("GEOS") ); \
return r; \
}
QString tr(const char *sourceText, const char *disambiguation, int n)
static void logMessage(const QString &message, const QString &tag=QString::null, MessageLevel level=WARNING)
add a message to the instance (and create it if necessary)

Definition at line 34 of file qgsgeos.cpp.

◆ CATCH_GEOS_WITH_ERRMSG

#define CATCH_GEOS_WITH_ERRMSG (   r)
Value:
catch (GEOSException &e) \
{ \
QgsMessageLog::logMessage( QObject::tr( "Exception: %1" ).arg( e.what() ), QObject::tr("GEOS") ); \
if ( errorMsg ) \
{ \
*errorMsg = e.what(); \
} \
return r; \
}
QString tr(const char *sourceText, const char *disambiguation, int n)
static void logMessage(const QString &message, const QString &tag=QString::null, MessageLevel level=WARNING)
add a message to the instance (and create it if necessary)

Definition at line 41 of file qgsgeos.cpp.

◆ DEFAULT_QUADRANT_SEGMENTS

#define DEFAULT_QUADRANT_SEGMENTS   8

Definition at line 32 of file qgsgeos.cpp.

Function Documentation

◆ _linestringEndpoints()

static bool _linestringEndpoints ( const GEOSGeometry *  linestring,
double &  x1,
double &  y1,
double &  x2,
double &  y2 
)
static

Extract coordinates of linestring's endpoints.

Returns false on error.

Definition at line 1927 of file qgsgeos.cpp.

◆ _mergeLinestrings()

static GEOSGeometry* _mergeLinestrings ( const GEOSGeometry *  line1,
const GEOSGeometry *  line2,
const QgsPoint interesectionPoint 
)
static

Merge two linestrings if they meet at the given intersection point, return new geometry or null on error.

Definition at line 1949 of file qgsgeos.cpp.