QGIS API Documentation  2.99.0-Master (7d4f81d)
qgsgeometry.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsgeometry.h - Geometry (stored as Open Geospatial Consortium WKB)
3  -------------------------------------------------------------------
4 Date : 02 May 2005
5 Copyright : (C) 2005 by Brendan Morley
6 email : morb at ozemail dot com dot au
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSGEOMETRY_H
17 #define QGSGEOMETRY_H
18 
19 #include <QDomDocument>
20 #include <QSet>
21 #include <QString>
22 #include <QVector>
23 
24 #include <geos_c.h>
25 #include <climits>
26 #include <limits>
27 
28 #include "qgis_core.h"
29 #include "qgis.h"
30 
31 
32 #if defined(GEOS_VERSION_MAJOR) && (GEOS_VERSION_MAJOR<3)
33 #define GEOSGeometry struct GEOSGeom_t
34 #define GEOSCoordSequence struct GEOSCoordSeq_t
35 #endif
36 
37 #include "qgsabstractgeometry.h"
38 #include "qgsfeature.h"
39 #include "qgspointxy.h"
40 #include "qgspoint.h"
41 
42 
43 class QgsGeometryEngine;
44 class QgsVectorLayer;
45 class QgsMapToPixel;
46 class QPainter;
47 class QgsPolygonV2;
49 
51 typedef QVector<QgsPointXY> QgsPolyline;
52 
54 #ifndef SIP_RUN
55 typedef QVector<QgsPolyline> QgsPolygon;
56 #else
57 typedef QVector<QVector<QgsPointXY>> QgsPolygon;
58 #endif
59 
61 #ifndef SIP_RUN
62 typedef QVector<QgsPointXY> QgsMultiPoint;
63 #else
64 typedef QVector<QgsPointXY> QgsMultiPoint;
65 #endif
66 
68 #ifndef SIP_RUN
69 typedef QVector<QgsPolyline> QgsMultiPolyline;
70 #else
71 typedef QVector<QVector<QgsPointXY>> QgsMultiPolyline;
72 #endif
73 
75 #ifndef SIP_RUN
76 typedef QVector<QgsPolygon> QgsMultiPolygon;
77 #else
78 typedef QVector<QVector<QVector<QgsPointXY>>> QgsMultiPolygon;
79 #endif
80 
81 class QgsRectangle;
82 
83 class QgsConstWkbPtr;
84 
85 struct QgsGeometryPrivate;
86 
96 class CORE_EXPORT QgsGeometry
97 {
98  public:
99 
105  {
106  Success = 0,
107  NothingHappened = 1000,
111  /* Add part issues */
114  /* Add ring issues*/
119  /* Split features */
121  };
122 
124  QgsGeometry();
125 
127  QgsGeometry( const QgsGeometry & );
128 
133  QgsGeometry &operator=( QgsGeometry const &rhs ) SIP_SKIP;
134 
140  explicit QgsGeometry( QgsAbstractGeometry *geom SIP_TRANSFER );
141 
142 
143  ~QgsGeometry();
144 
150  QgsAbstractGeometry *geometry() const;
151 
157  void setGeometry( QgsAbstractGeometry *geometry SIP_TRANSFER );
158 
166  bool isNull() const;
167 
169  static QgsGeometry fromWkt( const QString &wkt );
171  static QgsGeometry fromPoint( const QgsPointXY &point );
173  static QgsGeometry fromMultiPoint( const QgsMultiPoint &multipoint );
175  static QgsGeometry fromPolyline( const QgsPolyline &polyline );
177  static QgsGeometry fromMultiPolyline( const QgsMultiPolyline &multiline );
179  static QgsGeometry fromPolygon( const QgsPolygon &polygon );
181  static QgsGeometry fromMultiPolygon( const QgsMultiPolygon &multipoly );
183  static QgsGeometry fromRect( const QgsRectangle &rect );
185  static QgsGeometry collectGeometry( const QList< QgsGeometry > &geometries );
186 
192  void fromGeos( GEOSGeometry *geos ) SIP_SKIP;
193 
199  void fromWkb( unsigned char *wkb, int length ) SIP_SKIP;
200 
205  void fromWkb( const QByteArray &wkb );
206 
212  GEOSGeometry *exportToGeos( double precision = 0 ) const SIP_SKIP;
213 
217  QgsWkbTypes::Type wkbType() const;
218 
222  QgsWkbTypes::GeometryType type() const;
223 
230  bool isEmpty() const;
231 
233  bool isMultipart() const;
234 
238  bool isGeosEqual( const QgsGeometry & ) const;
239 
243  bool isGeosValid() const;
244 
252  bool isSimple() const;
253 
258  double area() const;
259 
264  double length() const;
265 
272  double distance( const QgsGeometry &geom ) const;
273 
286  //TODO QGIS 3.0 - rename beforeVertex to previousVertex, afterVertex to nextVertex
287  QgsPointXY closestVertex( const QgsPointXY &point, int &atVertex SIP_OUT, int &beforeVertex SIP_OUT, int &afterVertex SIP_OUT, double &sqrDist SIP_OUT ) const;
288 
295  double distanceToVertex( int vertex ) const;
296 
304  double angleAtVertex( int vertex ) const;
305 
318  void adjacentVertices( int atVertex, int &beforeVertex SIP_OUT, int &afterVertex SIP_OUT ) const;
319 
331  bool insertVertex( double x, double y, int beforeVertex );
332 
344  bool insertVertex( const QgsPoint &point, int beforeVertex );
345 
353  bool moveVertex( double x, double y, int atVertex );
354 
362  bool moveVertex( const QgsPoint &p, int atVertex );
363 
375  bool deleteVertex( int atVertex );
376 
382  QgsPoint vertexAt( int atVertex ) const;
383 
389  double sqrDistToVertexAt( QgsPointXY &point SIP_IN, int atVertex ) const;
390 
396  QgsGeometry nearestPoint( const QgsGeometry &other ) const;
397 
403  QgsGeometry shortestLine( const QgsGeometry &other ) const;
404 
411  double closestVertexWithContext( const QgsPointXY &point, int &atVertex SIP_OUT ) const;
412 
423 #ifndef SIP_RUN
424  double closestSegmentWithContext( const QgsPointXY &point, QgsPointXY &minDistPoint, int &afterVertex, double *leftOf = nullptr, double epsilon = DEFAULT_SEGMENT_EPSILON ) const;
425 #else
426  double closestSegmentWithContext( const QgsPointXY &point, QgsPointXY &minDistPoint SIP_OUT, int &afterVertex SIP_OUT ) const;
427 #endif
428 
434  OperationResult addRing( const QList<QgsPointXY> &ring );
435 
441  OperationResult addRing( QgsCurve *ring SIP_TRANSFER );
442 
449  OperationResult addPart( const QList<QgsPointXY> &points, QgsWkbTypes::GeometryType geomType = QgsWkbTypes::UnknownGeometry ) SIP_PYNAME( addPoints );
450 
457  OperationResult addPart( const QgsPointSequence &points, QgsWkbTypes::GeometryType geomType = QgsWkbTypes::UnknownGeometry ) SIP_PYNAME( addPointsV2 );
458 
466 
473  OperationResult addPart( GEOSGeometry *newPart ) SIP_SKIP;
474 
480  OperationResult addPart( const QgsGeometry &newPart ) SIP_PYNAME( addPartGeometry );
481 
488  QgsGeometry removeInteriorRings( double minimumAllowedArea = -1 ) const;
489 
494  OperationResult translate( double dx, double dy );
495 
500  OperationResult transform( const QgsCoordinateTransform &ct );
501 
506  OperationResult transform( const QTransform &ct );
507 
514  OperationResult rotate( double rotation, const QgsPointXY &center );
515 
524  OperationResult splitGeometry( const QList<QgsPointXY> &splitLine, QList<QgsGeometry> &newGeometries SIP_OUT, bool topological, QList<QgsPointXY> &topologyTestPoints SIP_OUT );
525 
530  OperationResult reshapeGeometry( const QgsLineString &reshapeLineString );
531 
537  int makeDifferenceInPlace( const QgsGeometry &other ) SIP_SKIP;
538 
546  QgsGeometry makeDifference( const QgsGeometry &other ) const;
547 
552  QgsRectangle boundingBox() const;
553 
561  QgsGeometry orientedMinimumBoundingBox( double &area SIP_OUT, double &angle SIP_OUT, double &width SIP_OUT, double &height SIP_OUT ) const;
562 
571  QgsGeometry orthogonalize( double tolerance = 1.0E-8, int maxIterations = 1000, double angleThreshold = 15.0 ) const;
572 
574  bool intersects( const QgsRectangle &r ) const;
575 
577  bool intersects( const QgsGeometry &geometry ) const;
578 
580  bool contains( const QgsPointXY *p ) const;
581 
585  bool contains( const QgsGeometry &geometry ) const;
586 
590  bool disjoint( const QgsGeometry &geometry ) const;
591 
595  bool equals( const QgsGeometry &geometry ) const;
596 
600  bool touches( const QgsGeometry &geometry ) const;
601 
605  bool overlaps( const QgsGeometry &geometry ) const;
606 
610  bool within( const QgsGeometry &geometry ) const;
611 
615  bool crosses( const QgsGeometry &geometry ) const;
616 
619  {
620  SideLeft = 0,
622  };
623 
626  {
627  CapRound = 1,
630  };
631 
634  {
635  JoinStyleRound = 1,
638  };
639 
644  QgsGeometry buffer( double distance, int segments ) const;
645 
655  QgsGeometry buffer( double distance, int segments, EndCapStyle endCapStyle, JoinStyle joinStyle, double miterLimit ) const;
656 
665  QgsGeometry offsetCurve( double distance, int segments, JoinStyle joinStyle, double miterLimit ) const;
666 
679  QgsGeometry singleSidedBuffer( double distance, int segments, BufferSide side,
680  JoinStyle joinStyle = JoinStyleRound,
681  double miterLimit = 2.0 ) const;
682 
689  QgsGeometry extendLine( double startDistance, double endDistance ) const;
690 
692  QgsGeometry simplify( double tolerance ) const;
693 
703  QgsGeometry densifyByCount( int extraNodesPerSegment ) const;
704 
719  QgsGeometry densifyByDistance( double distance ) const;
720 
734  QgsGeometry centroid() const;
735 
749  QgsGeometry pointOnSurface() const;
750 
763  QgsGeometry poleOfInaccessibility( double precision, double *distanceToBoundary SIP_OUT = nullptr ) const;
764 
773  QgsGeometry convexHull() const;
774 
790  QgsGeometry voronoiDiagram( const QgsGeometry &extent = QgsGeometry(), double tolerance = 0.0, bool edgesOnly = false ) const;
791 
801  QgsGeometry delaunayTriangulation( double tolerance = 0.0, bool edgesOnly = false ) const;
802 
822  QgsGeometry subdivide( int maxNodes = 256 ) const;
823 
835  QgsGeometry interpolate( double distance ) const;
836 
848  double lineLocatePoint( const QgsGeometry &point ) const;
849 
859  double interpolateAngle( double distance ) const;
860 
869  QgsGeometry intersection( const QgsGeometry &geometry ) const;
870 
878  QgsGeometry clipped( const QgsRectangle &rectangle );
879 
891  QgsGeometry combine( const QgsGeometry &geometry ) const;
892 
901  QgsGeometry mergeLines() const;
902 
911  QgsGeometry difference( const QgsGeometry &geometry ) const;
912 
921  QgsGeometry symDifference( const QgsGeometry &geometry ) const;
922 
924  QgsGeometry extrude( double x, double y );
925 
929  QByteArray exportToWkb() const;
930 
936  QString exportToWkt( int precision = 17 ) const;
937 
945  QString exportToGeoJSON( int precision = 17 ) const;
946 
954  QgsGeometry convertToType( QgsWkbTypes::GeometryType destType, bool destMultipart = false ) const SIP_FACTORY;
955 
956  /* Accessor functions for getting geometry data */
957 
962  QgsPointXY asPoint() const;
963 
968  QgsPolyline asPolyline() const;
969 
974  QgsPolygon asPolygon() const;
975 
980  QgsMultiPoint asMultiPoint() const;
981 
986  QgsMultiPolyline asMultiPolyline() const;
987 
992  QgsMultiPolygon asMultiPolygon() const;
993 
998  QList<QgsGeometry> asGeometryCollection() const;
999 
1005  QPointF asQPointF() const;
1006 
1013  QPolygonF asQPolygonF() const;
1014 
1021  bool deleteRing( int ringNum, int partNum = 0 );
1022 
1028  bool deletePart( int partNum );
1029 
1038  bool convertToMultiType();
1039 
1049  bool convertToSingleType();
1050 
1061  int avoidIntersections( const QList<QgsVectorLayer *> &avoidIntersectionsLayers,
1062  const QHash<QgsVectorLayer *, QSet<QgsFeatureId> > &ignoreFeatures SIP_PYARGREMOVE = ( QHash<QgsVectorLayer *, QSet<QgsFeatureId> >() ) );
1063 
1082  QgsGeometry makeValid();
1083 
1086  class CORE_EXPORT Error
1087  {
1088  QString message;
1089  QgsPointXY location;
1090  bool hasLocation;
1091 
1092  public:
1094  : message( QStringLiteral( "none" ) )
1095  , hasLocation( false ) {}
1096 
1097  explicit Error( const QString &m )
1098  : message( m )
1099  , hasLocation( false ) {}
1100 
1101  Error( const QString &m, const QgsPointXY &p )
1102  : message( m )
1103  , location( p )
1104  , hasLocation( true ) {}
1105 
1106  QString what() { return message; }
1107  QgsPointXY where() { return location; }
1108  bool hasWhere() { return hasLocation; }
1109  };
1110 
1116  {
1119  };
1120 
1127  void validateGeometry( QList<QgsGeometry::Error> &errors SIP_OUT, ValidationMethod method = ValidatorQgisInternal );
1128 
1133  static QgsGeometry unaryUnion( const QList<QgsGeometry> &geometries );
1134 
1143  static QgsGeometry polygonize( const QList< QgsGeometry> &geometries );
1144 
1150  void convertToStraightSegment();
1151 
1158  bool requiresConversionToStraightSegments() const;
1159 
1165  void mapToPixel( const QgsMapToPixel &mtp );
1166 
1172  void draw( QPainter &p ) const;
1173 
1182  bool vertexIdFromVertexNr( int nr, QgsVertexId &id SIP_OUT ) const;
1183 
1191  int vertexNrFromVertexId( QgsVertexId i ) const;
1192 
1199  QString error() const;
1200 
1206  static GEOSContextHandle_t getGEOSHandler() SIP_SKIP;
1207 
1213  static QgsGeometry fromQPointF( QPointF point );
1214 
1222  static QgsGeometry fromQPolygonF( const QPolygonF &polygon );
1223 
1230  static QgsPolyline createPolylineFromQPolygonF( const QPolygonF &polygon ) SIP_FACTORY;
1231 
1238  static QgsPolygon createPolygonFromQPolygonF( const QPolygonF &polygon ) SIP_FACTORY;
1239 
1240 #ifndef SIP_RUN
1241 
1250  static bool compare( const QgsPolyline &p1, const QgsPolyline &p2,
1251  double epsilon = 4 * std::numeric_limits<double>::epsilon() );
1252 
1262  static bool compare( const QgsPolygon &p1, const QgsPolygon &p2,
1263  double epsilon = 4 * std::numeric_limits<double>::epsilon() );
1264 
1275  static bool compare( const QgsMultiPolygon &p1, const QgsMultiPolygon &p2,
1276  double epsilon = 4 * std::numeric_limits<double>::epsilon() );
1277 #else
1278 
1297  static bool compare( PyObject *obj1, PyObject *obj2, double epsilon = 4 * DBL_EPSILON );
1298  % MethodCode
1299  {
1300  sipRes = false;
1301  int state0;
1302  int state1;
1303  int sipIsErr = 0;
1304 
1305  if ( PyList_Check( a0 ) && PyList_Check( a1 ) &&
1306  PyList_GET_SIZE( a0 ) && PyList_GET_SIZE( a1 ) )
1307  {
1308  PyObject *o0 = PyList_GetItem( a0, 0 );
1309  PyObject *o1 = PyList_GetItem( a1, 0 );
1310  if ( o0 && o1 )
1311  {
1312  // compare polyline - polyline
1313  if ( sipCanConvertToType( o0, sipType_QgsPointXY, SIP_NOT_NONE ) &&
1314  sipCanConvertToType( o1, sipType_QgsPointXY, SIP_NOT_NONE ) &&
1315  sipCanConvertToType( a0, sipType_QVector_0100QgsPointXY, SIP_NOT_NONE ) &&
1316  sipCanConvertToType( a1, sipType_QVector_0100QgsPointXY, SIP_NOT_NONE ) )
1317  {
1318  QgsPolyline *p0;
1319  QgsPolyline *p1;
1320  p0 = reinterpret_cast<QgsPolyline *>( sipConvertToType( a0, sipType_QVector_0100QgsPointXY, 0, SIP_NOT_NONE, &state0, &sipIsErr ) );
1321  p1 = reinterpret_cast<QgsPolyline *>( sipConvertToType( a1, sipType_QVector_0100QgsPointXY, 0, SIP_NOT_NONE, &state1, &sipIsErr ) );
1322  if ( sipIsErr )
1323  {
1324  sipReleaseType( p0, sipType_QVector_0100QgsPointXY, state0 );
1325  sipReleaseType( p1, sipType_QVector_0100QgsPointXY, state1 );
1326  }
1327  else
1328  {
1329  sipRes = QgsGeometry::compare( *p0, *p1, a2 );
1330  }
1331  }
1332  else if ( PyList_Check( o0 ) && PyList_Check( o1 ) &&
1333  PyList_GET_SIZE( o0 ) && PyList_GET_SIZE( o1 ) )
1334  {
1335  PyObject *oo0 = PyList_GetItem( o0, 0 );
1336  PyObject *oo1 = PyList_GetItem( o1, 0 );
1337  if ( oo0 && oo1 )
1338  {
1339  // compare polygon - polygon
1340  if ( sipCanConvertToType( oo0, sipType_QgsPointXY, SIP_NOT_NONE ) &&
1341  sipCanConvertToType( oo1, sipType_QgsPointXY, SIP_NOT_NONE ) &&
1342  sipCanConvertToType( a0, sipType_QVector_0600QVector_0100QgsPointXY, SIP_NOT_NONE ) &&
1343  sipCanConvertToType( a1, sipType_QVector_0600QVector_0100QgsPointXY, SIP_NOT_NONE ) )
1344  {
1345  QgsPolygon *p0;
1346  QgsPolygon *p1;
1347  p0 = reinterpret_cast<QgsPolygon *>( sipConvertToType( a0, sipType_QVector_0600QVector_0100QgsPointXY, 0, SIP_NOT_NONE, &state0, &sipIsErr ) );
1348  p1 = reinterpret_cast<QgsPolygon *>( sipConvertToType( a1, sipType_QVector_0600QVector_0100QgsPointXY, 0, SIP_NOT_NONE, &state1, &sipIsErr ) );
1349  if ( sipIsErr )
1350  {
1351  sipReleaseType( p0, sipType_QVector_0600QVector_0100QgsPointXY, state0 );
1352  sipReleaseType( p1, sipType_QVector_0600QVector_0100QgsPointXY, state1 );
1353  }
1354  else
1355  {
1356  sipRes = QgsGeometry::compare( *p0, *p1, a2 );
1357  }
1358  }
1359  else if ( PyList_Check( oo0 ) && PyList_Check( oo1 ) &&
1360  PyList_GET_SIZE( oo0 ) && PyList_GET_SIZE( oo1 ) )
1361  {
1362  PyObject *ooo0 = PyList_GetItem( oo0, 0 );
1363  PyObject *ooo1 = PyList_GetItem( oo1, 0 );
1364  if ( ooo0 && ooo1 )
1365  {
1366  // compare multipolygon - multipolygon
1367  if ( sipCanConvertToType( ooo0, sipType_QgsPointXY, SIP_NOT_NONE ) &&
1368  sipCanConvertToType( ooo1, sipType_QgsPointXY, SIP_NOT_NONE ) &&
1369  sipCanConvertToType( a0, sipType_QVector_0600QVector_0600QVector_0100QgsPointXY, SIP_NOT_NONE ) &&
1370  sipCanConvertToType( a1, sipType_QVector_0600QVector_0600QVector_0100QgsPointXY, SIP_NOT_NONE ) )
1371  {
1372  QgsMultiPolygon *p0;
1373  QgsMultiPolygon *p1;
1374  p0 = reinterpret_cast<QgsMultiPolygon *>( sipConvertToType( a0, sipType_QVector_0600QVector_0600QVector_0100QgsPointXY, 0, SIP_NOT_NONE, &state0, &sipIsErr ) );
1375  p1 = reinterpret_cast<QgsMultiPolygon *>( sipConvertToType( a1, sipType_QVector_0600QVector_0600QVector_0100QgsPointXY, 0, SIP_NOT_NONE, &state1, &sipIsErr ) );
1376  if ( sipIsErr )
1377  {
1378  sipReleaseType( p0, sipType_QVector_0600QVector_0600QVector_0100QgsPointXY, state0 );
1379  sipReleaseType( p1, sipType_QVector_0600QVector_0600QVector_0100QgsPointXY, state1 );
1380  }
1381  else
1382  {
1383  sipRes = QgsGeometry::compare( *p0, *p1, a2 );
1384  }
1385  }
1386  }
1387  }
1388  }
1389  }
1390  }
1391  }
1392  }
1393  % End
1394 #endif
1395 
1408  QgsGeometry smooth( const unsigned int iterations = 1, const double offset = 0.25,
1409  double minimumDistance = -1.0, double maxAngle = 180.0 ) const;
1410 
1414  static QgsGeometryEngine *createGeometryEngine( const QgsAbstractGeometry *geometry ) SIP_FACTORY;
1415 
1421  static void convertPointList( const QList<QgsPointXY> &input, QgsPointSequence &output );
1422 
1428  static void convertPointList( const QgsPointSequence &input, QList<QgsPointXY> &output );
1429 
1431  operator QVariant() const
1432  {
1433  return QVariant::fromValue( *this );
1434  }
1435 
1441  operator bool() const;
1442 
1443  private:
1444 
1445  QgsGeometryPrivate *d; //implicitly shared data pointer
1446 
1447  void detach( bool cloneGeom = true ); //make sure mGeometry only referenced from this instance
1448 
1449  static void convertToPolyline( const QgsPointSequence &input, QgsPolyline &output );
1450  static void convertPolygon( const QgsPolygonV2 &input, QgsPolygon &output );
1451 
1453  QgsGeometry convertToPoint( bool destMultipart ) const;
1455  QgsGeometry convertToLine( bool destMultipart ) const;
1457  QgsGeometry convertToPolygon( bool destMultipart ) const;
1458 
1469  QgsLineString *smoothLine( const QgsLineString &line, const unsigned int iterations = 1, const double offset = 0.25,
1470  double minimumDistance = -1, double maxAngle = 180.0 ) const;
1471 
1482  QgsPolygonV2 *smoothPolygon( const QgsPolygonV2 &polygon, const unsigned int iterations = 1, const double offset = 0.25,
1483  double minimumDistance = -1, double maxAngle = 180.0 ) const;
1484 
1485 
1486 }; // class QgsGeometry
1487 
1489 
1490 CORE_EXPORT QDataStream &operator<<( QDataStream &out, const QgsGeometry &geometry );
1493 CORE_EXPORT QDataStream &operator>>( QDataStream &in, QgsGeometry &geometry );
1494 
1495 #endif
Geometry engine misses a method implemented or an error occurred in the geometry engine.
Definition: qgsgeometry.h:110
A rectangle specified with double values.
Definition: qgsrectangle.h:38
The input ring doesn&#39;t have any existing ring to fit into.
Definition: qgsgeometry.h:118
The source geometry is not multi.
Definition: qgsgeometry.h:113
Use GEOS validation methods.
Definition: qgsgeometry.h:1118
Error(const QString &m)
Definition: qgsgeometry.h:1097
static bool compare(const QgsPolyline &p1, const QgsPolyline &p2, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compares two polylines for equality within a specified tolerance.
double ANALYSIS_EXPORT leftOf(QgsPoint *thepoint, QgsPoint *p1, QgsPoint *p2)
Returns whether &#39;thepoint&#39; is left or right of the line from &#39;p1&#39; to &#39;p2&#39;. Negativ values mean left a...
Definition: MathUtils.cc:310
Handles storage of information regarding WKB types and their properties.
Definition: qgswkbtypes.h:39
A class to represent a 2D point.
Definition: qgspointxy.h:42
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:96
Use mitered joins.
Definition: qgsgeometry.h:636
EndCapStyle
End cap styles for buffers.
Definition: qgsgeometry.h:625
Q_DECLARE_METATYPE(QModelIndex)
OperationResult
Success or failure of a geometry operation.
Definition: qgsgeometry.h:104
double ANALYSIS_EXPORT angle(QgsPoint *p1, QgsPoint *p2, QgsPoint *p3, QgsPoint *p4)
Calculates the angle between two segments (in 2 dimension, z-values are ignored)
Definition: MathUtils.cc:857
Error(const QString &m, const QgsPointXY &p)
Definition: qgsgeometry.h:1101
QVector< QgsPointXY > QgsPolyline
Polyline is represented as a vector of points.
Definition: qgsgeometry.h:48
The input geometry (ring, part, split line, etc.) has not the correct geometry type.
Definition: qgsgeometry.h:109
#define SIP_IN
Definition: qgis_sip.h:56
CORE_EXPORT QDataStream & operator<<(QDataStream &out, const QgsGeometry &geometry)
Writes the geometry to stream out. QGIS version compatibility is not guaranteed.
Perform transforms between map coordinates and device coordinates.
Definition: qgsmaptopixel.h:35
Polygon geometry type.
Definition: qgspolygon.h:30
The selected geometry cannot be found.
Definition: qgsgeometry.h:112
Utility class for identifying a unique vertex within a geometry.
const double DEFAULT_SEGMENT_EPSILON
Default snapping tolerance for segments.
Definition: qgis.h:345
The input ring crosses existing rings (it is not disjoint)
Definition: qgsgeometry.h:117
#define SIP_SKIP
Definition: qgis_sip.h:119
QgsPointXY where()
Definition: qgsgeometry.h:1107
Use internal QgsGeometryValidator method.
Definition: qgsgeometry.h:1117
#define SIP_TRANSFER
Definition: qgis_sip.h:36
QVector< QgsPolygon > QgsMultiPolygon
A collection of QgsPolygons that share a common collection of attributes.
Definition: qgsgeometry.h:76
The imput ring is not closed.
Definition: qgsgeometry.h:115
Square cap (extends past start/end of line by buffer distance)
Definition: qgsgeometry.h:629
Abstract base class for curved geometry type.
Definition: qgscurve.h:34
#define SIP_FACTORY
Definition: qgis_sip.h:69
QVector< QgsPolyline > QgsPolygon
Polygon: first item of the list is outer ring, inner rings (if any) start from second item...
Definition: qgsgeometry.h:55
Abstract base class for all geometries.
Point geometry type, with support for z-dimension and m-values.
Definition: qgspoint.h:36
CORE_EXPORT QDataStream & operator>>(QDataStream &in, QgsGeometry &geometry)
Reads a geometry from stream in into geometry. QGIS version compatibility is not guaranteed.
QVector< QgsPolyline > QgsMultiPolyline
A collection of QgsPolylines that share a common collection of attributes.
Definition: qgsgeometry.h:69
BufferSide
Side of line to buffer.
Definition: qgsgeometry.h:618
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
Definition: qgswkbtypes.h:136
#define SIP_PYARGREMOVE
Definition: qgis_sip.h:139
The base geometry on which the operation is done is invalid or empty.
Definition: qgsgeometry.h:108
#define SIP_OUT
Definition: qgis_sip.h:51
Line string geometry type, with support for z-dimension and m-values.
Definition: qgslinestring.h:40
ValidationMethod
Available methods for validating geometries.
Definition: qgsgeometry.h:1115
QVector< QgsPointXY > QgsMultiPoint
A collection of QgsPoints that share a common collection of attributes.
Definition: qgsgeometry.h:62
Buffer to right of line.
Definition: qgsgeometry.h:621
Class for doing transforms between two map coordinate systems.
The input ring is not valid.
Definition: qgsgeometry.h:116
qint64 QgsFeatureId
Definition: qgsfeature.h:37
Contains geometry relation and modification algorithms.
Use beveled joins.
Definition: qgsgeometry.h:637
JoinStyle
Join styles for buffers.
Definition: qgsgeometry.h:633
QList< QgsPoint > QgsPointSequence
Flat cap (in line with start/end of line)
Definition: qgsgeometry.h:628
Represents a vector layer which manages a vector based data sets.
#define SIP_PYNAME(name)
Definition: qgis_sip.h:74