QGIS API Documentation  2.99.0-Master (9fdd060)
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 #include <memory>
28 
29 #include "qgis_core.h"
30 #include "qgis.h"
31 
32 
33 #if defined(GEOS_VERSION_MAJOR) && (GEOS_VERSION_MAJOR<3)
34 #define GEOSGeometry struct GEOSGeom_t
35 #define GEOSCoordSequence struct GEOSCoordSeq_t
36 #endif
37 
38 #include "qgsabstractgeometry.h"
39 #include "qgsfeature.h"
40 #include "qgspointxy.h"
41 #include "qgspoint.h"
42 
43 
44 class QgsGeometryEngine;
45 class QgsVectorLayer;
46 class QgsMapToPixel;
47 class QPainter;
48 class QgsPolygonV2;
50 
52 typedef QVector<QgsPointXY> QgsPolyline;
53 
55 #ifndef SIP_RUN
56 typedef QVector<QgsPolyline> QgsPolygon;
57 #else
58 typedef QVector<QVector<QgsPointXY>> QgsPolygon;
59 #endif
60 
62 typedef QVector<QgsPointXY> QgsMultiPoint;
63 
65 #ifndef SIP_RUN
66 typedef QVector<QgsPolyline> QgsMultiPolyline;
67 #else
68 typedef QVector<QVector<QgsPointXY>> QgsMultiPolyline;
69 #endif
70 
72 #ifndef SIP_RUN
73 typedef QVector<QgsPolygon> QgsMultiPolygon;
74 #else
75 typedef QVector<QVector<QVector<QgsPointXY>>> QgsMultiPolygon;
76 #endif
77 
78 class QgsRectangle;
79 
80 class QgsConstWkbPtr;
81 
82 struct QgsGeometryPrivate;
83 
94 class CORE_EXPORT QgsGeometry
95 {
96  public:
97 
103  {
104  Success = 0,
105  NothingHappened = 1000,
109  /* Add part issues */
112  /* Add ring issues*/
117  /* Split features */
119  };
120 
122  QgsGeometry();
123 
125  QgsGeometry( const QgsGeometry & );
126 
131  QgsGeometry &operator=( QgsGeometry const &rhs ) SIP_SKIP;
132 
138  explicit QgsGeometry( QgsAbstractGeometry *geom SIP_TRANSFER );
139 
145  explicit QgsGeometry( std::unique_ptr< QgsAbstractGeometry > geom ) SIP_SKIP;
146 
147  ~QgsGeometry();
148 
154  QgsAbstractGeometry *geometry() const;
155 
161  void setGeometry( QgsAbstractGeometry *geometry SIP_TRANSFER );
162 
170  bool isNull() const;
171 
173  static QgsGeometry fromWkt( const QString &wkt );
175  static QgsGeometry fromPoint( const QgsPointXY &point );
177  static QgsGeometry fromMultiPoint( const QgsMultiPoint &multipoint );
179  static QgsGeometry fromPolyline( const QgsPolyline &polyline );
181  static QgsGeometry fromMultiPolyline( const QgsMultiPolyline &multiline );
183  static QgsGeometry fromPolygon( const QgsPolygon &polygon );
185  static QgsGeometry fromMultiPolygon( const QgsMultiPolygon &multipoly );
187  static QgsGeometry fromRect( const QgsRectangle &rect );
189  static QgsGeometry collectGeometry( const QList< QgsGeometry > &geometries );
190 
196  void fromGeos( GEOSGeometry *geos ) SIP_SKIP;
197 
203  void fromWkb( unsigned char *wkb, int length ) SIP_SKIP;
204 
209  void fromWkb( const QByteArray &wkb );
210 
217  GEOSGeometry *exportToGeos( double precision = 0 ) const SIP_SKIP;
218 
223  QgsWkbTypes::Type wkbType() const;
224 
229  QgsWkbTypes::GeometryType type() const;
230 
237  bool isEmpty() const;
238 
240  bool isMultipart() const;
241 
246  bool isGeosEqual( const QgsGeometry & ) const;
247 
252  bool isGeosValid() const;
253 
262  bool isSimple() const;
263 
268  double area() const;
269 
274  double length() const;
275 
282  double distance( const QgsGeometry &geom ) const;
283 
284 #ifndef SIP_RUN
285 
290  QgsAbstractGeometry::vertex_iterator vertices_begin() const;
291 
296  QgsAbstractGeometry::vertex_iterator vertices_end() const;
297 #endif
298 
303  QgsVertexIterator vertices() const;
304 
322  double hausdorffDistance( const QgsGeometry &geom ) const;
323 
342  double hausdorffDistanceDensify( const QgsGeometry &geom, double densifyFraction ) const;
343 
356  //TODO QGIS 3.0 - rename beforeVertex to previousVertex, afterVertex to nextVertex
357  QgsPointXY closestVertex( const QgsPointXY &point, int &atVertex SIP_OUT, int &beforeVertex SIP_OUT, int &afterVertex SIP_OUT, double &sqrDist SIP_OUT ) const;
358 
365  double distanceToVertex( int vertex ) const;
366 
374  double angleAtVertex( int vertex ) const;
375 
388  void adjacentVertices( int atVertex, int &beforeVertex SIP_OUT, int &afterVertex SIP_OUT ) const;
389 
402  bool insertVertex( double x, double y, int beforeVertex );
403 
416  bool insertVertex( const QgsPoint &point, int beforeVertex );
417 
425  bool moveVertex( double x, double y, int atVertex );
426 
434  bool moveVertex( const QgsPoint &p, int atVertex );
435 
447  bool deleteVertex( int atVertex );
448 
454  QgsPoint vertexAt( int atVertex ) const;
455 
461  double sqrDistToVertexAt( QgsPointXY &point SIP_IN, int atVertex ) const;
462 
468  QgsGeometry nearestPoint( const QgsGeometry &other ) const;
469 
475  QgsGeometry shortestLine( const QgsGeometry &other ) const;
476 
483  double closestVertexWithContext( const QgsPointXY &point, int &atVertex SIP_OUT ) const;
484 
495 #ifndef SIP_RUN
496  double closestSegmentWithContext( const QgsPointXY &point, QgsPointXY &minDistPoint, int &afterVertex, double *leftOf = nullptr, double epsilon = DEFAULT_SEGMENT_EPSILON ) const;
497 #else
498  double closestSegmentWithContext( const QgsPointXY &point, QgsPointXY &minDistPoint SIP_OUT, int &afterVertex SIP_OUT ) const;
499 #endif
500 
506  OperationResult addRing( const QList<QgsPointXY> &ring );
507 
513  OperationResult addRing( QgsCurve *ring SIP_TRANSFER );
514 
521  OperationResult addPart( const QList<QgsPointXY> &points, QgsWkbTypes::GeometryType geomType = QgsWkbTypes::UnknownGeometry ) SIP_PYNAME( addPoints );
522 
529  OperationResult addPart( const QgsPointSequence &points, QgsWkbTypes::GeometryType geomType = QgsWkbTypes::UnknownGeometry ) SIP_PYNAME( addPointsV2 );
530 
538 
545  OperationResult addPart( GEOSGeometry *newPart ) SIP_SKIP;
546 
552  OperationResult addPart( const QgsGeometry &newPart ) SIP_PYNAME( addPartGeometry );
553 
560  QgsGeometry removeInteriorRings( double minimumAllowedArea = -1 ) const;
561 
566  OperationResult translate( double dx, double dy );
567 
572  OperationResult transform( const QgsCoordinateTransform &ct );
573 
578  OperationResult transform( const QTransform &ct );
579 
586  OperationResult rotate( double rotation, const QgsPointXY &center );
587 
596  OperationResult splitGeometry( const QList<QgsPointXY> &splitLine, QList<QgsGeometry> &newGeometries SIP_OUT, bool topological, QList<QgsPointXY> &topologyTestPoints SIP_OUT );
597 
602  OperationResult reshapeGeometry( const QgsLineString &reshapeLineString );
603 
609  int makeDifferenceInPlace( const QgsGeometry &other ) SIP_SKIP;
610 
618  QgsGeometry makeDifference( const QgsGeometry &other ) const;
619 
624  QgsRectangle boundingBox() const;
625 
633  QgsGeometry orientedMinimumBoundingBox( double &area SIP_OUT, double &angle SIP_OUT, double &width SIP_OUT, double &height SIP_OUT ) const;
634 
640  QgsGeometry orientedMinimumBoundingBox() const SIP_SKIP;
641 
649  QgsGeometry minimalEnclosingCircle( QgsPointXY &center SIP_OUT, double &radius SIP_OUT, unsigned int segments = 36 ) const;
650 
656  QgsGeometry minimalEnclosingCircle( unsigned int segments = 36 ) const SIP_SKIP;
657 
666  QgsGeometry orthogonalize( double tolerance = 1.0E-8, int maxIterations = 1000, double angleThreshold = 15.0 ) const;
667 
669  bool intersects( const QgsRectangle &r ) const;
670 
672  bool intersects( const QgsGeometry &geometry ) const;
673 
675  bool contains( const QgsPointXY *p ) const;
676 
681  bool contains( const QgsGeometry &geometry ) const;
682 
687  bool disjoint( const QgsGeometry &geometry ) const;
688 
693  bool equals( const QgsGeometry &geometry ) const;
694 
699  bool touches( const QgsGeometry &geometry ) const;
700 
705  bool overlaps( const QgsGeometry &geometry ) const;
706 
711  bool within( const QgsGeometry &geometry ) const;
712 
717  bool crosses( const QgsGeometry &geometry ) const;
718 
721  {
722  SideLeft = 0,
724  };
725 
728  {
729  CapRound = 1,
732  };
733 
736  {
737  JoinStyleRound = 1,
740  };
741 
746  QgsGeometry buffer( double distance, int segments ) const;
747 
757  QgsGeometry buffer( double distance, int segments, EndCapStyle endCapStyle, JoinStyle joinStyle, double miterLimit ) const;
758 
767  QgsGeometry offsetCurve( double distance, int segments, JoinStyle joinStyle, double miterLimit ) const;
768 
781  QgsGeometry singleSidedBuffer( double distance, int segments, BufferSide side,
782  JoinStyle joinStyle = JoinStyleRound,
783  double miterLimit = 2.0 ) const;
784 
791  QgsGeometry extendLine( double startDistance, double endDistance ) const;
792 
794  QgsGeometry simplify( double tolerance ) const;
795 
805  QgsGeometry densifyByCount( int extraNodesPerSegment ) const;
806 
821  QgsGeometry densifyByDistance( double distance ) const;
822 
836  QgsGeometry centroid() const;
837 
851  QgsGeometry pointOnSurface() const;
852 
865  QgsGeometry poleOfInaccessibility( double precision, double *distanceToBoundary SIP_OUT = nullptr ) const;
866 
875  QgsGeometry convexHull() const;
876 
892  QgsGeometry voronoiDiagram( const QgsGeometry &extent = QgsGeometry(), double tolerance = 0.0, bool edgesOnly = false ) const;
893 
903  QgsGeometry delaunayTriangulation( double tolerance = 0.0, bool edgesOnly = false ) const;
904 
924  QgsGeometry subdivide( int maxNodes = 256 ) const;
925 
937  QgsGeometry interpolate( double distance ) const;
938 
950  double lineLocatePoint( const QgsGeometry &point ) const;
951 
961  double interpolateAngle( double distance ) const;
962 
971  QgsGeometry intersection( const QgsGeometry &geometry ) const;
972 
980  QgsGeometry clipped( const QgsRectangle &rectangle );
981 
993  QgsGeometry combine( const QgsGeometry &geometry ) const;
994 
1003  QgsGeometry mergeLines() const;
1004 
1013  QgsGeometry difference( const QgsGeometry &geometry ) const;
1014 
1023  QgsGeometry symDifference( const QgsGeometry &geometry ) const;
1024 
1026  QgsGeometry extrude( double x, double y );
1027 
1032  QByteArray exportToWkb() const;
1033 
1039  QString exportToWkt( int precision = 17 ) const;
1040 
1048  QString exportToGeoJSON( int precision = 17 ) const;
1049 
1057  QgsGeometry convertToType( QgsWkbTypes::GeometryType destType, bool destMultipart = false ) const SIP_FACTORY;
1058 
1059  /* Accessor functions for getting geometry data */
1060 
1065  QgsPointXY asPoint() const;
1066 
1071  QgsPolyline asPolyline() const;
1072 
1077  QgsPolygon asPolygon() const;
1078 
1083  QgsMultiPoint asMultiPoint() const;
1084 
1089  QgsMultiPolyline asMultiPolyline() const;
1090 
1095  QgsMultiPolygon asMultiPolygon() const;
1096 
1101  QList<QgsGeometry> asGeometryCollection() const;
1102 
1108  QPointF asQPointF() const;
1109 
1116  QPolygonF asQPolygonF() const;
1117 
1124  bool deleteRing( int ringNum, int partNum = 0 );
1125 
1131  bool deletePart( int partNum );
1132 
1141  bool convertToMultiType();
1142 
1152  bool convertToSingleType();
1153 
1164  int avoidIntersections( const QList<QgsVectorLayer *> &avoidIntersectionsLayers,
1165  const QHash<QgsVectorLayer *, QSet<QgsFeatureId> > &ignoreFeatures SIP_PYARGREMOVE = ( QHash<QgsVectorLayer *, QSet<QgsFeatureId> >() ) );
1166 
1185  QgsGeometry makeValid() const;
1186 
1190  class CORE_EXPORT Error
1191  {
1192  QString message;
1193  QgsPointXY location;
1194  bool hasLocation = false;
1195 
1196  public:
1198  : message( QStringLiteral( "none" ) )
1199  {}
1200 
1201  explicit Error( const QString &m )
1202  : message( m )
1203  {}
1204 
1205  Error( const QString &m, const QgsPointXY &p )
1206  : message( m )
1207  , location( p )
1208  , hasLocation( true ) {}
1209 
1210  QString what() { return message; }
1211  QgsPointXY where() { return location; }
1212  bool hasWhere() { return hasLocation; }
1213  };
1214 
1220  {
1223  };
1224 
1231  void validateGeometry( QList<QgsGeometry::Error> &errors SIP_OUT, ValidationMethod method = ValidatorQgisInternal ) const;
1232 
1238  static QgsGeometry unaryUnion( const QList<QgsGeometry> &geometries );
1239 
1248  static QgsGeometry polygonize( const QList< QgsGeometry> &geometries );
1249 
1255  void convertToStraightSegment();
1256 
1263  bool requiresConversionToStraightSegments() const;
1264 
1270  void mapToPixel( const QgsMapToPixel &mtp );
1271 
1277  void draw( QPainter &p ) const;
1278 
1287  bool vertexIdFromVertexNr( int nr, QgsVertexId &id SIP_OUT ) const;
1288 
1296  int vertexNrFromVertexId( QgsVertexId i ) const;
1297 
1305  QString lastError() const;
1306 
1312  static GEOSContextHandle_t getGEOSHandler() SIP_SKIP;
1313 
1319  static QgsGeometry fromQPointF( QPointF point );
1320 
1328  static QgsGeometry fromQPolygonF( const QPolygonF &polygon );
1329 
1336  static QgsPolyline createPolylineFromQPolygonF( const QPolygonF &polygon ) SIP_FACTORY;
1337 
1344  static QgsPolygon createPolygonFromQPolygonF( const QPolygonF &polygon ) SIP_FACTORY;
1345 
1346 #ifndef SIP_RUN
1347 
1357  static bool compare( const QgsPolyline &p1, const QgsPolyline &p2,
1358  double epsilon = 4 * std::numeric_limits<double>::epsilon() );
1359 
1369  static bool compare( const QgsPolygon &p1, const QgsPolygon &p2,
1370  double epsilon = 4 * std::numeric_limits<double>::epsilon() );
1371 
1382  static bool compare( const QgsMultiPolygon &p1, const QgsMultiPolygon &p2,
1383  double epsilon = 4 * std::numeric_limits<double>::epsilon() );
1384 #else
1385 
1404  static bool compare( PyObject *obj1, PyObject *obj2, double epsilon = 4 * DBL_EPSILON );
1405  % MethodCode
1406  {
1407  sipRes = false;
1408  int state0;
1409  int state1;
1410  int sipIsErr = 0;
1411 
1412  if ( PyList_Check( a0 ) && PyList_Check( a1 ) &&
1413  PyList_GET_SIZE( a0 ) && PyList_GET_SIZE( a1 ) )
1414  {
1415  PyObject *o0 = PyList_GetItem( a0, 0 );
1416  PyObject *o1 = PyList_GetItem( a1, 0 );
1417  if ( o0 && o1 )
1418  {
1419  // compare polyline - polyline
1420  if ( sipCanConvertToType( o0, sipType_QgsPointXY, SIP_NOT_NONE ) &&
1421  sipCanConvertToType( o1, sipType_QgsPointXY, SIP_NOT_NONE ) &&
1422  sipCanConvertToType( a0, sipType_QVector_0100QgsPointXY, SIP_NOT_NONE ) &&
1423  sipCanConvertToType( a1, sipType_QVector_0100QgsPointXY, SIP_NOT_NONE ) )
1424  {
1425  QgsPolyline *p0;
1426  QgsPolyline *p1;
1427  p0 = reinterpret_cast<QgsPolyline *>( sipConvertToType( a0, sipType_QVector_0100QgsPointXY, 0, SIP_NOT_NONE, &state0, &sipIsErr ) );
1428  p1 = reinterpret_cast<QgsPolyline *>( sipConvertToType( a1, sipType_QVector_0100QgsPointXY, 0, SIP_NOT_NONE, &state1, &sipIsErr ) );
1429  if ( sipIsErr )
1430  {
1431  sipReleaseType( p0, sipType_QVector_0100QgsPointXY, state0 );
1432  sipReleaseType( p1, sipType_QVector_0100QgsPointXY, state1 );
1433  }
1434  else
1435  {
1436  sipRes = QgsGeometry::compare( *p0, *p1, a2 );
1437  }
1438  }
1439  else if ( PyList_Check( o0 ) && PyList_Check( o1 ) &&
1440  PyList_GET_SIZE( o0 ) && PyList_GET_SIZE( o1 ) )
1441  {
1442  PyObject *oo0 = PyList_GetItem( o0, 0 );
1443  PyObject *oo1 = PyList_GetItem( o1, 0 );
1444  if ( oo0 && oo1 )
1445  {
1446  // compare polygon - polygon
1447  if ( sipCanConvertToType( oo0, sipType_QgsPointXY, SIP_NOT_NONE ) &&
1448  sipCanConvertToType( oo1, sipType_QgsPointXY, SIP_NOT_NONE ) &&
1449  sipCanConvertToType( a0, sipType_QVector_0600QVector_0100QgsPointXY, SIP_NOT_NONE ) &&
1450  sipCanConvertToType( a1, sipType_QVector_0600QVector_0100QgsPointXY, SIP_NOT_NONE ) )
1451  {
1452  QgsPolygon *p0;
1453  QgsPolygon *p1;
1454  p0 = reinterpret_cast<QgsPolygon *>( sipConvertToType( a0, sipType_QVector_0600QVector_0100QgsPointXY, 0, SIP_NOT_NONE, &state0, &sipIsErr ) );
1455  p1 = reinterpret_cast<QgsPolygon *>( sipConvertToType( a1, sipType_QVector_0600QVector_0100QgsPointXY, 0, SIP_NOT_NONE, &state1, &sipIsErr ) );
1456  if ( sipIsErr )
1457  {
1458  sipReleaseType( p0, sipType_QVector_0600QVector_0100QgsPointXY, state0 );
1459  sipReleaseType( p1, sipType_QVector_0600QVector_0100QgsPointXY, state1 );
1460  }
1461  else
1462  {
1463  sipRes = QgsGeometry::compare( *p0, *p1, a2 );
1464  }
1465  }
1466  else if ( PyList_Check( oo0 ) && PyList_Check( oo1 ) &&
1467  PyList_GET_SIZE( oo0 ) && PyList_GET_SIZE( oo1 ) )
1468  {
1469  PyObject *ooo0 = PyList_GetItem( oo0, 0 );
1470  PyObject *ooo1 = PyList_GetItem( oo1, 0 );
1471  if ( ooo0 && ooo1 )
1472  {
1473  // compare multipolygon - multipolygon
1474  if ( sipCanConvertToType( ooo0, sipType_QgsPointXY, SIP_NOT_NONE ) &&
1475  sipCanConvertToType( ooo1, sipType_QgsPointXY, SIP_NOT_NONE ) &&
1476  sipCanConvertToType( a0, sipType_QVector_0600QVector_0600QVector_0100QgsPointXY, SIP_NOT_NONE ) &&
1477  sipCanConvertToType( a1, sipType_QVector_0600QVector_0600QVector_0100QgsPointXY, SIP_NOT_NONE ) )
1478  {
1479  QgsMultiPolygon *p0;
1480  QgsMultiPolygon *p1;
1481  p0 = reinterpret_cast<QgsMultiPolygon *>( sipConvertToType( a0, sipType_QVector_0600QVector_0600QVector_0100QgsPointXY, 0, SIP_NOT_NONE, &state0, &sipIsErr ) );
1482  p1 = reinterpret_cast<QgsMultiPolygon *>( sipConvertToType( a1, sipType_QVector_0600QVector_0600QVector_0100QgsPointXY, 0, SIP_NOT_NONE, &state1, &sipIsErr ) );
1483  if ( sipIsErr )
1484  {
1485  sipReleaseType( p0, sipType_QVector_0600QVector_0600QVector_0100QgsPointXY, state0 );
1486  sipReleaseType( p1, sipType_QVector_0600QVector_0600QVector_0100QgsPointXY, state1 );
1487  }
1488  else
1489  {
1490  sipRes = QgsGeometry::compare( *p0, *p1, a2 );
1491  }
1492  }
1493  }
1494  }
1495  }
1496  }
1497  }
1498  }
1499  }
1500  % End
1501 #endif
1502 
1515  QgsGeometry smooth( const unsigned int iterations = 1, const double offset = 0.25,
1516  double minimumDistance = -1.0, double maxAngle = 180.0 ) const;
1517 
1521  static QgsGeometryEngine *createGeometryEngine( const QgsAbstractGeometry *geometry ) SIP_FACTORY;
1522 
1528  static void convertPointList( const QList<QgsPointXY> &input, QgsPointSequence &output );
1529 
1535  static void convertPointList( const QgsPointSequence &input, QList<QgsPointXY> &output );
1536 
1538  operator QVariant() const
1539  {
1540  return QVariant::fromValue( *this );
1541  }
1542 
1548  operator bool() const;
1549 
1550  private:
1551 
1552  QgsGeometryPrivate *d; //implicitly shared data pointer
1553 
1555  mutable QString mLastError;
1556 
1561  void detach();
1562 
1567  void reset( std::unique_ptr< QgsAbstractGeometry > newGeometry );
1568 
1569  static void convertToPolyline( const QgsPointSequence &input, QgsPolyline &output );
1570  static void convertPolygon( const QgsPolygonV2 &input, QgsPolygon &output );
1571 
1573  QgsGeometry convertToPoint( bool destMultipart ) const;
1575  QgsGeometry convertToLine( bool destMultipart ) const;
1577  QgsGeometry convertToPolygon( bool destMultipart ) const;
1578 
1590  std::unique_ptr< QgsLineString > smoothLine( const QgsLineString &line, const unsigned int iterations = 1, const double offset = 0.25,
1591  double minimumDistance = -1, double maxAngle = 180.0 ) const;
1592 
1604  std::unique_ptr< QgsPolygonV2 > smoothPolygon( const QgsPolygonV2 &polygon, const unsigned int iterations = 1, const double offset = 0.25,
1605  double minimumDistance = -1, double maxAngle = 180.0 ) const;
1606 
1607 
1608 }; // class QgsGeometry
1609 
1611 
1612 CORE_EXPORT QDataStream &operator<<( QDataStream &out, const QgsGeometry &geometry );
1615 CORE_EXPORT QDataStream &operator>>( QDataStream &in, QgsGeometry &geometry );
1616 
1617 #endif
Geometry engine misses a method implemented or an error occurred in the geometry engine.
Definition: qgsgeometry.h:108
A rectangle specified with double values.
Definition: qgsrectangle.h:39
The input ring doesn&#39;t have any existing ring to fit into.
Definition: qgsgeometry.h:116
Java-style iterator for traversal of vertices of a geometry.
The source geometry is not multi.
Definition: qgsgeometry.h:111
Use GEOS validation methods.
Definition: qgsgeometry.h:1222
Error(const QString &m)
Definition: qgsgeometry.h:1201
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.cpp:292
Handles storage of information regarding WKB types and their properties.
Definition: qgswkbtypes.h:40
A class to represent a 2D point.
Definition: qgspointxy.h:43
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:94
Use mitered joins.
Definition: qgsgeometry.h:738
EndCapStyle
End cap styles for buffers.
Definition: qgsgeometry.h:727
Q_DECLARE_METATYPE(QModelIndex)
OperationResult
Success or failure of a geometry operation.
Definition: qgsgeometry.h:102
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.cpp:786
Error(const QString &m, const QgsPointXY &p)
Definition: qgsgeometry.h:1205
QVector< QgsPointXY > QgsPolyline
Polyline is represented as a vector of points.
Definition: qgsgeometry.h:49
The input geometry (ring, part, split line, etc.) has not the correct geometry type.
Definition: qgsgeometry.h:107
#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:36
Polygon geometry type.
Definition: qgspolygon.h:31
The selected geometry cannot be found.
Definition: qgsgeometry.h:110
Utility class for identifying a unique vertex within a geometry.
const double DEFAULT_SEGMENT_EPSILON
Default snapping tolerance for segments.
Definition: qgis.h:441
The input ring crosses existing rings (it is not disjoint)
Definition: qgsgeometry.h:115
#define SIP_SKIP
Definition: qgis_sip.h:119
QgsPointXY where()
Definition: qgsgeometry.h:1211
Use internal QgsGeometryValidator method.
Definition: qgsgeometry.h:1221
#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:73
The input ring is not closed.
Definition: qgsgeometry.h:113
Square cap (extends past start/end of line by buffer distance)
Definition: qgsgeometry.h:731
Abstract base class for curved geometry type.
Definition: qgscurve.h:35
#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:56
Abstract base class for all geometries.
The vertex_iterator class provides STL-style iterator for vertices.
Point geometry type, with support for z-dimension and m-values.
Definition: qgspoint.h:37
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:66
BufferSide
Side of line to buffer.
Definition: qgsgeometry.h:720
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
Definition: qgswkbtypes.h:137
#define SIP_PYARGREMOVE
Definition: qgis_sip.h:139
The base geometry on which the operation is done is invalid or empty.
Definition: qgsgeometry.h:106
#define SIP_OUT
Definition: qgis_sip.h:51
Line string geometry type, with support for z-dimension and m-values.
Definition: qgslinestring.h:41
ValidationMethod
Available methods for validating geometries.
Definition: qgsgeometry.h:1219
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:723
Class for doing transforms between two map coordinate systems.
The input ring is not valid.
Definition: qgsgeometry.h:114
qint64 QgsFeatureId
Definition: qgsfeature.h:37
Contains geometry relation and modification algorithms.
Use beveled joins.
Definition: qgsgeometry.h:739
JoinStyle
Join styles for buffers.
Definition: qgsgeometry.h:735
QList< QgsPoint > QgsPointSequence
Flat cap (in line with start/end of line)
Definition: qgsgeometry.h:730
Represents a vector layer which manages a vector based data sets.
#define SIP_PYNAME(name)
Definition: qgis_sip.h:74