QGIS API Documentation  3.10.0-A Coruña (6c816b4204)
qgslinestring.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgslinestring.h
3  -----------------
4  begin : September 2014
5  copyright : (C) 2014 by Marco Hugentobler
6  email : marco at sourcepole dot ch
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSLINESTRING_H
19 #define QGSLINESTRING_H
20 
21 
22 #include <QPolygonF>
23 
24 #include "qgis_core.h"
25 #include "qgis_sip.h"
26 #include "qgscurve.h"
27 #include "qgscompoundcurve.h"
28 
29 class QgsLineSegment2D;
30 
31 /***************************************************************************
32  * This class is considered CRITICAL and any change MUST be accompanied with
33  * full unit tests in testqgsgeometry.cpp.
34  * See details in QEP #17
35  ****************************************************************************/
36 
43 class CORE_EXPORT QgsLineString: public QgsCurve
44 {
45  public:
46  QgsLineString();
47 
54  QgsLineString( const QVector<QgsPoint> &points );
55 
71  QgsLineString( const QVector<double> &x, const QVector<double> &y,
72  const QVector<double> &z = QVector<double>(),
73  const QVector<double> &m = QVector<double>(), bool is25DType = false );
74 
79  QgsLineString( const QgsPoint &p1, const QgsPoint &p2 );
80 
87  QgsLineString( const QVector<QgsPointXY> &points );
88 
93  explicit QgsLineString( const QgsLineSegment2D &segment );
94 
105  static QgsLineString *fromBezierCurve( const QgsPoint &start, const QgsPoint &controlPoint1, const QgsPoint &controlPoint2, const QgsPoint &end, int segments = 30 ) SIP_FACTORY;
106 
112  static QgsLineString *fromQPolygonF( const QPolygonF &polygon ) SIP_FACTORY;
113 
114  bool equals( const QgsCurve &other ) const override;
115 
116 #ifndef SIP_RUN
117 
122  QgsPoint pointN( int i ) const;
123 #else
124 
131  SIP_PYOBJECT pointN( int i ) const SIP_TYPEHINT( QgsPoint );
132  % MethodCode
133  const int count = sipCpp->numPoints();
134  if ( a0 < -count || a0 >= count )
135  {
136  PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
137  sipIsErr = 1;
138  }
139  else
140  {
141  std::unique_ptr< QgsPoint > p;
142  if ( a0 >= 0 )
143  p = qgis::make_unique< QgsPoint >( sipCpp->pointN( a0 ) );
144  else // negative index, count backwards from end
145  p = qgis::make_unique< QgsPoint >( sipCpp->pointN( count + a0 ) );
146  sipRes = sipConvertFromType( p.release(), sipType_QgsPoint, Py_None );
147  }
148  % End
149 #endif
150 
151 #ifndef SIP_RUN
152  double xAt( int index ) const override;
153 #else
154 
163  double xAt( int index ) const override;
164  % MethodCode
165  const int count = sipCpp->numPoints();
166  if ( a0 < -count || a0 >= count )
167  {
168  PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
169  sipIsErr = 1;
170  }
171  else
172  {
173  if ( a0 >= 0 )
174  return PyFloat_FromDouble( sipCpp->xAt( a0 ) );
175  else
176  return PyFloat_FromDouble( sipCpp->xAt( count + a0 ) );
177  }
178  % End
179 #endif
180 
181 #ifndef SIP_RUN
182  double yAt( int index ) const override;
183 #else
184 
193  double yAt( int index ) const override;
194  % MethodCode
195  const int count = sipCpp->numPoints();
196  if ( a0 < -count || a0 >= count )
197  {
198  PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
199  sipIsErr = 1;
200  }
201  else
202  {
203  if ( a0 >= 0 )
204  return PyFloat_FromDouble( sipCpp->yAt( a0 ) );
205  else
206  return PyFloat_FromDouble( sipCpp->yAt( count + a0 ) );
207  }
208  % End
209 #endif
210 
217  const double *xData() const SIP_SKIP
218  {
219  return mX.constData();
220  }
221 
228  const double *yData() const SIP_SKIP
229  {
230  return mY.constData();
231  }
232 
241  const double *zData() const SIP_SKIP
242  {
243  if ( mZ.empty() )
244  return nullptr;
245  else
246  return mZ.constData();
247  }
248 
257  const double *mData() const SIP_SKIP
258  {
259  if ( mM.empty() )
260  return nullptr;
261  else
262  return mM.constData();
263  }
264 
265 #ifndef SIP_RUN
266 
274  double zAt( int index ) const
275  {
276  if ( index >= 0 && index < mZ.size() )
277  return mZ.at( index );
278  else
279  return std::numeric_limits<double>::quiet_NaN();
280  }
281 #else
282 
293  double zAt( int index ) const;
294  % MethodCode
295  const int count = sipCpp->numPoints();
296  if ( a0 < -count || a0 >= count )
297  {
298  PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
299  sipIsErr = 1;
300  }
301  else
302  {
303  if ( a0 >= 0 )
304  return PyFloat_FromDouble( sipCpp->zAt( a0 ) );
305  else
306  return PyFloat_FromDouble( sipCpp->zAt( count + a0 ) );
307  }
308  % End
309 #endif
310 
311 #ifndef SIP_RUN
312 
320  double mAt( int index ) const
321  {
322  if ( index >= 0 && index < mM.size() )
323  return mM.at( index );
324  else
325  return std::numeric_limits<double>::quiet_NaN();
326  }
327 #else
328 
339  double mAt( int index ) const;
340  % MethodCode
341  const int count = sipCpp->numPoints();
342  if ( a0 < -count || a0 >= count )
343  {
344  PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
345  sipIsErr = 1;
346  }
347  else
348  {
349  if ( a0 >= 0 )
350  return PyFloat_FromDouble( sipCpp->mAt( a0 ) );
351  else
352  return PyFloat_FromDouble( sipCpp->mAt( count + a0 ) );
353  }
354  % End
355 #endif
356 
357 #ifndef SIP_RUN
358 
366  void setXAt( int index, double x );
367 #else
368 
380  void setXAt( int index, double x );
381  % MethodCode
382  const int count = sipCpp->numPoints();
383  if ( a0 < -count || a0 >= count )
384  {
385  PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
386  sipIsErr = 1;
387  }
388  else
389  {
390  if ( a0 >= 0 )
391  sipCpp->setXAt( a0, a1 );
392  else
393  sipCpp->setXAt( count + a0, a1 );
394  }
395  % End
396 #endif
397 
398 #ifndef SIP_RUN
399 
407  void setYAt( int index, double y );
408 #else
409 
421  void setYAt( int index, double y );
422  % MethodCode
423  const int count = sipCpp->numPoints();
424  if ( a0 < -count || a0 >= count )
425  {
426  PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
427  sipIsErr = 1;
428  }
429  else
430  {
431  if ( a0 >= 0 )
432  sipCpp->setYAt( a0, a1 );
433  else
434  sipCpp->setYAt( count + a0, a1 );
435  }
436  % End
437 #endif
438 
439 #ifndef SIP_RUN
440 
448  void setZAt( int index, double z )
449  {
450  if ( index >= 0 && index < mZ.size() )
451  mZ[ index ] = z;
452  }
453 #else
454 
466  void setZAt( int index, double z );
467  % MethodCode
468  const int count = sipCpp->numPoints();
469  if ( a0 < -count || a0 >= count )
470  {
471  PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
472  sipIsErr = 1;
473  }
474  else
475  {
476  if ( a0 >= 0 )
477  sipCpp->setZAt( a0, a1 );
478  else
479  sipCpp->setZAt( count + a0, a1 );
480  }
481  % End
482 #endif
483 
484 #ifndef SIP_RUN
485 
493  void setMAt( int index, double m )
494  {
495  if ( index >= 0 && index < mM.size() )
496  mM[ index ] = m;
497  }
498 #else
499 
511  void setMAt( int index, double m );
512  % MethodCode
513  const int count = sipCpp->numPoints();
514  if ( a0 < -count || a0 >= count )
515  {
516  PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
517  sipIsErr = 1;
518  }
519  else
520  {
521  if ( a0 >= 0 )
522  sipCpp->setMAt( a0, a1 );
523  else
524  sipCpp->setMAt( count + a0, a1 );
525  }
526  % End
527 #endif
528 
534  void setPoints( const QgsPointSequence &points );
535 
540  void append( const QgsLineString *line );
541 
546  void addVertex( const QgsPoint &pt );
547 
549  void close();
550 
554  QgsCompoundCurve *toCurveType() const override SIP_FACTORY;
555 
562  void extend( double startDistance, double endDistance );
563 
564  //reimplemented methods
565 
566  QString geometryType() const override;
567  int dimension() const override;
568  QgsLineString *clone() const override SIP_FACTORY;
569  void clear() override;
570  bool isEmpty() const override;
571  QgsLineString *snappedToGrid( double hSpacing, double vSpacing, double dSpacing = 0, double mSpacing = 0 ) const override SIP_FACTORY;
572  bool removeDuplicateNodes( double epsilon = 4 * std::numeric_limits<double>::epsilon(), bool useZValues = false ) override;
573  QPolygonF asQPolygonF() const override;
574 
575  bool fromWkb( QgsConstWkbPtr &wkb ) override;
576  bool fromWkt( const QString &wkt ) override;
577 
578  QByteArray asWkb() const override;
579  QString asWkt( int precision = 17 ) const override;
580  QDomElement asGml2( QDomDocument &doc, int precision = 17, const QString &ns = "gml", QgsAbstractGeometry::AxisOrder axisOrder = QgsAbstractGeometry::AxisOrder::XY ) const override;
581  QDomElement asGml3( QDomDocument &doc, int precision = 17, const QString &ns = "gml", QgsAbstractGeometry::AxisOrder axisOrder = QgsAbstractGeometry::AxisOrder::XY ) const override;
582  json asJsonObject( int precision = 17 ) const override SIP_SKIP;
583 
584  //curve interface
585  double length() const override;
586 
593  double length3D() const;
594  QgsPoint startPoint() const override;
595  QgsPoint endPoint() const override;
596 
602  QgsLineString *curveToLine( double tolerance = M_PI_2 / 90, SegmentationToleranceType toleranceType = MaximumAngle ) const override SIP_FACTORY;
603 
604  int numPoints() const override;
605  int nCoordinates() const override;
606  void points( QgsPointSequence &pt SIP_OUT ) const override;
607 
608  void draw( QPainter &p ) const override;
609 
611  void transform( const QTransform &t, double zTranslate = 0.0, double zScale = 1.0, double mTranslate = 0.0, double mScale = 1.0 ) override;
612 
613  void addToPainterPath( QPainterPath &path ) const override;
614  void drawAsPolygon( QPainter &p ) const override;
615 
616  bool insertVertex( QgsVertexId position, const QgsPoint &vertex ) override;
617  bool moveVertex( QgsVertexId position, const QgsPoint &newPos ) override;
618  bool deleteVertex( QgsVertexId position ) override;
619 
620  QgsLineString *reversed() const override SIP_FACTORY;
621  QgsPoint *interpolatePoint( double distance ) const override SIP_FACTORY;
622  QgsLineString *curveSubstring( double startDistance, double endDistance ) const override SIP_FACTORY;
623 
624  double closestSegment( const QgsPoint &pt, QgsPoint &segmentPt SIP_OUT, QgsVertexId &vertexAfter SIP_OUT, int *leftOf SIP_OUT = nullptr, double epsilon = 4 * std::numeric_limits<double>::epsilon() ) const override;
625  bool pointAt( int node, QgsPoint &point, QgsVertexId::VertexType &type ) const override;
626 
627  QgsPoint centroid() const override;
628 
629  void sumUpArea( double &sum SIP_OUT ) const override;
630  double vertexAngle( QgsVertexId vertex ) const override;
631  double segmentLength( QgsVertexId startVertex ) const override;
632  bool addZValue( double zValue = 0 ) override;
633  bool addMValue( double mValue = 0 ) override;
634 
635  bool dropZValue() override;
636  bool dropMValue() override;
637  void swapXy() override;
638 
639  bool convertTo( QgsWkbTypes::Type type ) override;
640 
641 #ifndef SIP_RUN
642  void filterVertices( const std::function< bool( const QgsPoint & ) > &filter ) override;
643  void transformVertices( const std::function< QgsPoint( const QgsPoint & ) > &transform ) override;
644 
652  inline const QgsLineString *cast( const QgsAbstractGeometry *geom ) const
653  {
654  if ( geom && QgsWkbTypes::flatType( geom->wkbType() ) == QgsWkbTypes::LineString )
655  return static_cast<const QgsLineString *>( geom );
656  return nullptr;
657  }
658 #endif
659 
661 
662 #ifdef SIP_RUN
663  SIP_PYOBJECT __repr__();
664  % MethodCode
665  QString wkt = sipCpp->asWkt();
666  if ( wkt.length() > 1000 )
667  wkt = wkt.left( 1000 ) + QStringLiteral( "..." );
668  QString str = QStringLiteral( "<QgsLineString: %1>" ).arg( wkt );
669  sipRes = PyUnicode_FromString( str.toUtf8().constData() );
670  % End
671 
680  SIP_PYOBJECT __getitem__( int index ) SIP_TYPEHINT( QgsPoint );
681  % MethodCode
682  const int count = sipCpp->numPoints();
683  if ( a0 < -count || a0 >= count )
684  {
685  PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
686  sipIsErr = 1;
687  }
688  else
689  {
690  std::unique_ptr< QgsPoint > p;
691  if ( a0 >= 0 )
692  p = qgis::make_unique< QgsPoint >( sipCpp->pointN( a0 ) );
693  else
694  p = qgis::make_unique< QgsPoint >( sipCpp->pointN( count + a0 ) );
695  sipRes = sipConvertFromType( p.release(), sipType_QgsPoint, Py_None );
696  }
697  % End
698 
707  void __setitem__( int index, const QgsPoint &point );
708  % MethodCode
709  const int count = sipCpp->numPoints();
710  if ( a0 < -count || a0 >= count )
711  {
712  PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
713  sipIsErr = 1;
714  }
715  else
716  {
717  if ( a0 < 0 )
718  a0 = count + a0;
719  sipCpp->setXAt( a0, a1->x() );
720  sipCpp->setYAt( a0, a1->y() );
721  if ( sipCpp->isMeasure() )
722  sipCpp->setMAt( a0, a1->m() );
723  if ( sipCpp->is3D() )
724  sipCpp->setZAt( a0, a1->z() );
725  }
726  % End
727 
728 
737  void __delitem__( int index );
738  % MethodCode
739  const int count = sipCpp->numPoints();
740  if ( a0 >= 0 && a0 < count )
741  sipCpp->deleteVertex( QgsVertexId( -1, -1, a0 ) );
742  else if ( a0 < 0 && a0 >= -count )
743  sipCpp->deleteVertex( QgsVertexId( -1, -1, count + a0 ) );
744  else
745  {
746  PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
747  sipIsErr = 1;
748  }
749  % End
750 
751 #endif
752 
753  protected:
754 
755  QgsRectangle calculateBoundingBox() const override;
756 
757  private:
758  QVector<double> mX;
759  QVector<double> mY;
760  QVector<double> mZ;
761  QVector<double> mM;
762 
763  void importVerticesFromWkb( const QgsConstWkbPtr &wkb );
764 
770  void fromWkbPoints( QgsWkbTypes::Type type, const QgsConstWkbPtr &wkb )
771  {
772  mWkbType = type;
773  importVerticesFromWkb( wkb );
774  }
775 
776  friend class QgsPolygon;
777  friend class QgsTriangle;
778 
779 };
780 
781 // clazy:excludeall=qstring-allocations
782 
783 #endif // QGSLINESTRING_H
virtual QgsCurve * reversed() const =0
Returns a reversed copy of the curve, where the direction of the curve has been flipped.
virtual QString asWkt(int precision=17) const =0
Returns a WKT representation of the geometry.
int precision
A rectangle specified with double values.
Definition: qgsrectangle.h:41
virtual QgsAbstractGeometry * snappedToGrid(double hSpacing, double vSpacing, double dSpacing=0, double mSpacing=0) const =0
Makes a new geometry with all the points or vertices snapped to the closest point of the grid...
virtual bool isEmpty() const
Returns true if the geometry is empty.
virtual void transformVertices(const std::function< QgsPoint(const QgsPoint &) > &transform)
Transforms the vertices from the geometry in place, applying the transform function to every vertex...
virtual bool deleteVertex(QgsVertexId position)=0
Deletes a vertex within the geometry.
virtual QgsPoint * interpolatePoint(double distance) const =0
Returns an interpolated point on the curve at the specified distance.
virtual void transform(const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d=QgsCoordinateTransform::ForwardTransform, bool transformZ=false) SIP_THROW(QgsCsException)=0
Transforms the geometry using a coordinate transform.
double zAt(int index) const
Returns the z-coordinate of the specified node in the line string.
virtual QByteArray asWkb() const =0
Returns a WKB representation of the geometry.
const double * mData() const
Returns a const pointer to the m vertex data, or nullptr if the linestring does not have m values...
virtual bool insertVertex(QgsVertexId position, const QgsPoint &vertex)=0
Inserts a vertex into the geometry.
TransformDirection
Enum used to indicate the direction (forward or inverse) of the transform.
virtual double vertexAngle(QgsVertexId vertex) const =0
Returns approximate angle at a vertex.
virtual bool addMValue(double mValue=0)=0
Adds a measure to the geometry, initialized to a preset value.
virtual void sumUpArea(double &sum) const =0
Sums up the area of the curve by iterating over the vertices (shoelace formula).
virtual QgsAbstractGeometry * createEmptyWithSameType() const =0
Creates a new geometry with the same class and same WKB type as the original and transfers ownership...
virtual QDomElement asGml2(QDomDocument &doc, int precision=17, const QString &ns="gml", AxisOrder axisOrder=QgsAbstractGeometry::AxisOrder::XY) const =0
Returns a GML2 representation of the geometry.
SegmentationToleranceType
Segmentation tolerance as maximum angle or maximum difference between approximation and circle...
virtual bool pointAt(int node, QgsPoint &point, QgsVertexId::VertexType &type) const =0
Returns the point and vertex id of a point within the curve.
virtual bool equals(const QgsCurve &other) const =0
Checks whether this curve exactly equals another curve.
Triangle geometry type.
Definition: qgstriangle.h:33
#define SIP_TYPEHINT(type)
Definition: qgis_sip.h:213
virtual QgsPoint centroid() const
Returns the centroid of the geometry.
virtual QgsPoint endPoint() const =0
Returns the end point of the curve.
const double * xData() const
Returns a const pointer to the x vertex data.
virtual QPolygonF asQPolygonF() const
Returns a QPolygonF representing the points.
Definition: qgscurve.cpp:212
virtual double length() const
Returns the planar, 2-dimensional length of the geometry.
Type
The WKB type describes the number of dimensions a geometry has.
Definition: qgswkbtypes.h:68
virtual double closestSegment(const QgsPoint &pt, QgsPoint &segmentPt, QgsVertexId &vertexAfter, int *leftOf=nullptr, double epsilon=4 *std::numeric_limits< double >::epsilon()) const =0
Searches for the closest segment of the geometry to a given point.
virtual double segmentLength(QgsVertexId startVertex) const =0
Returns the length of the segment of the geometry which begins at startVertex.
virtual void filterVertices(const std::function< bool(const QgsPoint &) > &filter)
Filters the vertices from the geometry in place, removing any which do not return true for the filter...
virtual QgsCurve * curveSubstring(double startDistance, double endDistance) const =0
Returns a new curve representing a substring of this curve.
Utility class for identifying a unique vertex within a geometry.
#define SIP_SKIP
Definition: qgis_sip.h:126
double mAt(int index) const
Returns the m value of the specified node in the line string.
virtual double xAt(int index) const =0
Returns the x-coordinate of the specified node in the line string.
Abstract base class for curved geometry type.
Definition: qgscurve.h:35
#define SIP_FACTORY
Definition: qgis_sip.h:76
Abstract base class for all geometries.
virtual int dimension() const =0
Returns the inherent dimension of the geometry.
void setZAt(int index, double z)
Sets the z-coordinate of the specified node in the line string.
QgsWkbTypes::Type wkbType() const
Returns the WKB type of the geometry.
Point geometry type, with support for z-dimension and m-values.
Definition: qgspoint.h:37
const double * yData() const
Returns a const pointer to the y vertex data.
AxisOrder
Axis order for GML generation.
Represents a single 2D line segment, consisting of a 2D start and end vertex only.
const double * zData() const
Returns a const pointer to the z vertex data, or nullptr if the linestring does not have z values...
void setMAt(int index, double m)
Sets the m value of the specified node in the line string.
QVector< QgsPoint > QgsPointSequence
virtual void addToPainterPath(QPainterPath &path) const =0
Adds a curve to a painter path.
QgsCurve * toCurveType() const override
Returns the geometry converted to the more generic curve type.
Definition: qgscurve.cpp:179
virtual void clear()=0
Clears the geometry, ie reset it to a null geometry.
virtual bool moveVertex(QgsVertexId position, const QgsPoint &newPos)=0
Moves a vertex within the geometry.
QgsCurve * clone() const override=0
Clones the geometry by performing a deep copy.
virtual void draw(QPainter &p) const =0
Draws the geometry using the specified QPainter.
#define SIP_OUT
Definition: qgis_sip.h:58
const QgsLineString * cast(const QgsAbstractGeometry *geom) const
Cast the geom to a QgsLineString.
virtual bool addZValue(double zValue=0)=0
Adds a z-dimension to the geometry, initialized to a preset value.
Line string geometry type, with support for z-dimension and m-values.
Definition: qgslinestring.h:43
virtual QgsLineString * curveToLine(double tolerance=M_PI_2/90, SegmentationToleranceType toleranceType=MaximumAngle) const =0
Returns a new line string geometry corresponding to a segmentized approximation of the curve...
virtual QgsRectangle calculateBoundingBox() const
Default calculator for the minimal bounding box for the geometry.
virtual double yAt(int index) const =0
Returns the y-coordinate of the specified node in the line string.
Class for doing transforms between two map coordinate systems.
#define SIP_THROW(name)
Definition: qgis_sip.h:184
virtual bool convertTo(QgsWkbTypes::Type type)
Converts the geometry to a specified type.
Transform from source to destination CRS.
Compound curve geometry type.
virtual bool removeDuplicateNodes(double epsilon=4 *std::numeric_limits< double >::epsilon(), bool useZValues=false)=0
Removes duplicate nodes from the geometry, wherever removing the nodes does not result in a degenerat...
Custom exception class for Coordinate Reference System related exceptions.
Definition: qgsexception.h:65
virtual void drawAsPolygon(QPainter &p) const =0
Draws the curve as a polygon on the specified QPainter.
virtual bool dropMValue()=0
Drops any measure values which exist in the geometry.
virtual bool fromWkt(const QString &wkt)=0
Sets the geometry from a WKT string.
virtual QgsPoint startPoint() const =0
Returns the starting point of the curve.
Polygon geometry type.
Definition: qgspolygon.h:31
virtual int nCoordinates() const
Returns the number of nodes contained in the geometry.
static Type flatType(Type type)
Returns the flat type for a WKB type.
Definition: qgswkbtypes.h:576
virtual void swapXy()=0
Swaps the x and y coordinates from the geometry.
virtual int numPoints() const =0
Returns the number of points in the curve.
virtual json asJsonObject(int precision=17) const
Returns a json object representation of the geometry.
double ANALYSIS_EXPORT leftOf(const QgsPoint &thepoint, const QgsPoint *p1, const 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
virtual bool dropZValue()=0
Drops any z-dimensions which exist in the geometry.
virtual void points(QgsPointSequence &pt) const =0
Returns a list of points within the curve.
virtual QDomElement asGml3(QDomDocument &doc, int precision=17, const QString &ns="gml", AxisOrder axisOrder=QgsAbstractGeometry::AxisOrder::XY) const =0
Returns a GML3 representation of the geometry.
virtual QString geometryType() const =0
Returns a unique string representing the geometry type.
virtual bool fromWkb(QgsConstWkbPtr &wkb)=0
Sets the geometry from a WKB string.