QGIS API Documentation  3.4.15-Madeira (e83d02e274)
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 QGSLINESTRINGV2_H
19 #define QGSLINESTRINGV2_H
20 
21 
22 #include <QPolygonF>
23 
24 #include "qgis_core.h"
25 #include "qgis.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 
95  bool equals( const QgsCurve &other ) const override;
96 
97 #ifndef SIP_RUN
98 
103  QgsPoint pointN( int i ) const;
104 #else
105 
112  SIP_PYOBJECT pointN( int i ) const SIP_TYPEHINT( QgsPoint );
113  % MethodCode
114  const int count = sipCpp->numPoints();
115  if ( a0 < -count || a0 >= count )
116  {
117  PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
118  sipIsErr = 1;
119  }
120  else
121  {
122  std::unique_ptr< QgsPoint > p;
123  if ( a0 >= 0 )
124  p = qgis::make_unique< QgsPoint >( sipCpp->pointN( a0 ) );
125  else // negative index, count backwards from end
126  p = qgis::make_unique< QgsPoint >( sipCpp->pointN( count + a0 ) );
127  sipRes = sipConvertFromType( p.release(), sipType_QgsPoint, Py_None );
128  }
129  % End
130 #endif
131 
132 #ifndef SIP_RUN
133  double xAt( int index ) const override;
134 #else
135 
144  double xAt( int index ) const override;
145  % MethodCode
146  const int count = sipCpp->numPoints();
147  if ( a0 < -count || a0 >= count )
148  {
149  PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
150  sipIsErr = 1;
151  }
152  else
153  {
154  if ( a0 >= 0 )
155  return PyFloat_FromDouble( sipCpp->xAt( a0 ) );
156  else
157  return PyFloat_FromDouble( sipCpp->xAt( count + a0 ) );
158  }
159  % End
160 #endif
161 
162 #ifndef SIP_RUN
163  double yAt( int index ) const override;
164 #else
165 
174  double yAt( int index ) const override;
175  % MethodCode
176  const int count = sipCpp->numPoints();
177  if ( a0 < -count || a0 >= count )
178  {
179  PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
180  sipIsErr = 1;
181  }
182  else
183  {
184  if ( a0 >= 0 )
185  return PyFloat_FromDouble( sipCpp->yAt( a0 ) );
186  else
187  return PyFloat_FromDouble( sipCpp->yAt( count + a0 ) );
188  }
189  % End
190 #endif
191 
198  const double *xData() const SIP_SKIP
199  {
200  return mX.constData();
201  }
202 
209  const double *yData() const SIP_SKIP
210  {
211  return mY.constData();
212  }
213 
222  const double *zData() const SIP_SKIP
223  {
224  if ( mZ.empty() )
225  return nullptr;
226  else
227  return mZ.constData();
228  }
229 
238  const double *mData() const SIP_SKIP
239  {
240  if ( mM.empty() )
241  return nullptr;
242  else
243  return mM.constData();
244  }
245 
246 #ifndef SIP_RUN
247 
255  double zAt( int index ) const
256  {
257  if ( index >= 0 && index < mZ.size() )
258  return mZ.at( index );
259  else
260  return std::numeric_limits<double>::quiet_NaN();
261  }
262 #else
263 
274  double zAt( int index ) const;
275  % MethodCode
276  const int count = sipCpp->numPoints();
277  if ( a0 < -count || a0 >= count )
278  {
279  PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
280  sipIsErr = 1;
281  }
282  else
283  {
284  if ( a0 >= 0 )
285  return PyFloat_FromDouble( sipCpp->zAt( a0 ) );
286  else
287  return PyFloat_FromDouble( sipCpp->zAt( count + a0 ) );
288  }
289  % End
290 #endif
291 
292 #ifndef SIP_RUN
293 
301  double mAt( int index ) const
302  {
303  if ( index >= 0 && index < mM.size() )
304  return mM.at( index );
305  else
306  return std::numeric_limits<double>::quiet_NaN();
307  }
308 #else
309 
320  double mAt( int index ) const;
321  % MethodCode
322  const int count = sipCpp->numPoints();
323  if ( a0 < -count || a0 >= count )
324  {
325  PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
326  sipIsErr = 1;
327  }
328  else
329  {
330  if ( a0 >= 0 )
331  return PyFloat_FromDouble( sipCpp->mAt( a0 ) );
332  else
333  return PyFloat_FromDouble( sipCpp->mAt( count + a0 ) );
334  }
335  % End
336 #endif
337 
338 #ifndef SIP_RUN
339 
347  void setXAt( int index, double x );
348 #else
349 
361  void setXAt( int index, double x );
362  % MethodCode
363  const int count = sipCpp->numPoints();
364  if ( a0 < -count || a0 >= count )
365  {
366  PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
367  sipIsErr = 1;
368  }
369  else
370  {
371  if ( a0 >= 0 )
372  sipCpp->setXAt( a0, a1 );
373  else
374  sipCpp->setXAt( count + a0, a1 );
375  }
376  % End
377 #endif
378 
379 #ifndef SIP_RUN
380 
388  void setYAt( int index, double y );
389 #else
390 
402  void setYAt( int index, double y );
403  % MethodCode
404  const int count = sipCpp->numPoints();
405  if ( a0 < -count || a0 >= count )
406  {
407  PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
408  sipIsErr = 1;
409  }
410  else
411  {
412  if ( a0 >= 0 )
413  sipCpp->setYAt( a0, a1 );
414  else
415  sipCpp->setYAt( count + a0, a1 );
416  }
417  % End
418 #endif
419 
420 #ifndef SIP_RUN
421 
429  void setZAt( int index, double z )
430  {
431  if ( index >= 0 && index < mZ.size() )
432  mZ[ index ] = z;
433  }
434 #else
435 
447  void setZAt( int index, double z );
448  % MethodCode
449  const int count = sipCpp->numPoints();
450  if ( a0 < -count || a0 >= count )
451  {
452  PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
453  sipIsErr = 1;
454  }
455  else
456  {
457  if ( a0 >= 0 )
458  sipCpp->setZAt( a0, a1 );
459  else
460  sipCpp->setZAt( count + a0, a1 );
461  }
462  % End
463 #endif
464 
465 #ifndef SIP_RUN
466 
474  void setMAt( int index, double m )
475  {
476  if ( index >= 0 && index < mM.size() )
477  mM[ index ] = m;
478  }
479 #else
480 
492  void setMAt( int index, double m );
493  % MethodCode
494  const int count = sipCpp->numPoints();
495  if ( a0 < -count || a0 >= count )
496  {
497  PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
498  sipIsErr = 1;
499  }
500  else
501  {
502  if ( a0 >= 0 )
503  sipCpp->setMAt( a0, a1 );
504  else
505  sipCpp->setMAt( count + a0, a1 );
506  }
507  % End
508 #endif
509 
515  void setPoints( const QgsPointSequence &points );
516 
521  void append( const QgsLineString *line );
522 
527  void addVertex( const QgsPoint &pt );
528 
530  void close();
531 
535  QgsCompoundCurve *toCurveType() const override SIP_FACTORY;
536 
543  void extend( double startDistance, double endDistance );
544 
545  //reimplemented methods
546 
547  QString geometryType() const override;
548  int dimension() const override;
549  QgsLineString *clone() const override SIP_FACTORY;
550  void clear() override;
551  bool isEmpty() const override;
552  QgsLineString *snappedToGrid( double hSpacing, double vSpacing, double dSpacing = 0, double mSpacing = 0 ) const override SIP_FACTORY;
553  bool removeDuplicateNodes( double epsilon = 4 * std::numeric_limits<double>::epsilon(), bool useZValues = false ) override;
554  QPolygonF asQPolygonF() const override;
555 
556  bool fromWkb( QgsConstWkbPtr &wkb ) override;
557  bool fromWkt( const QString &wkt ) override;
558 
559  QByteArray asWkb() const override;
560  QString asWkt( int precision = 17 ) const override;
561  QDomElement asGml2( QDomDocument &doc, int precision = 17, const QString &ns = "gml", QgsAbstractGeometry::AxisOrder axisOrder = QgsAbstractGeometry::AxisOrder::XY ) const override;
562  QDomElement asGml3( QDomDocument &doc, int precision = 17, const QString &ns = "gml", QgsAbstractGeometry::AxisOrder axisOrder = QgsAbstractGeometry::AxisOrder::XY ) const override;
563  QString asJson( int precision = 17 ) const override;
564 
565  //curve interface
566  double length() const override;
567  QgsPoint startPoint() const override;
568  QgsPoint endPoint() const override;
569 
575  QgsLineString *curveToLine( double tolerance = M_PI_2 / 90, SegmentationToleranceType toleranceType = MaximumAngle ) const override SIP_FACTORY;
576 
577  int numPoints() const override;
578  int nCoordinates() const override;
579  void points( QgsPointSequence &pt SIP_OUT ) const override;
580 
581  void draw( QPainter &p ) const override;
582 
584  void transform( const QTransform &t, double zTranslate = 0.0, double zScale = 1.0, double mTranslate = 0.0, double mScale = 1.0 ) override;
585 
586  void addToPainterPath( QPainterPath &path ) const override;
587  void drawAsPolygon( QPainter &p ) const override;
588 
589  bool insertVertex( QgsVertexId position, const QgsPoint &vertex ) override;
590  bool moveVertex( QgsVertexId position, const QgsPoint &newPos ) override;
591  bool deleteVertex( QgsVertexId position ) override;
592 
593  QgsLineString *reversed() const override SIP_FACTORY;
594  QgsPoint *interpolatePoint( double distance ) const override SIP_FACTORY;
595  QgsLineString *curveSubstring( double startDistance, double endDistance ) const override SIP_FACTORY;
596 
597  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;
598  bool pointAt( int node, QgsPoint &point, QgsVertexId::VertexType &type ) const override;
599 
600  QgsPoint centroid() const override;
601 
602  void sumUpArea( double &sum SIP_OUT ) const override;
603  double vertexAngle( QgsVertexId vertex ) const override;
604  double segmentLength( QgsVertexId startVertex ) const override;
605  bool addZValue( double zValue = 0 ) override;
606  bool addMValue( double mValue = 0 ) override;
607 
608  bool dropZValue() override;
609  bool dropMValue() override;
610  void swapXy() override;
611 
612  bool convertTo( QgsWkbTypes::Type type ) override;
613 
614 #ifndef SIP_RUN
615  void filterVertices( const std::function< bool( const QgsPoint & ) > &filter ) override;
616  void transformVertices( const std::function< QgsPoint( const QgsPoint & ) > &transform ) override;
617 
625  inline const QgsLineString *cast( const QgsAbstractGeometry *geom ) const
626  {
627  if ( geom && QgsWkbTypes::flatType( geom->wkbType() ) == QgsWkbTypes::LineString )
628  return static_cast<const QgsLineString *>( geom );
629  return nullptr;
630  }
631 #endif
632 
634 
635 #ifdef SIP_RUN
636  SIP_PYOBJECT __repr__();
637  % MethodCode
638  QString wkt = sipCpp->asWkt();
639  if ( wkt.length() > 1000 )
640  wkt = wkt.left( 1000 ) + QStringLiteral( "..." );
641  QString str = QStringLiteral( "<QgsLineString: %1>" ).arg( wkt );
642  sipRes = PyUnicode_FromString( str.toUtf8().constData() );
643  % End
644 
653  SIP_PYOBJECT __getitem__( int index ) SIP_TYPEHINT( QgsPoint );
654  % MethodCode
655  const int count = sipCpp->numPoints();
656  if ( a0 < -count || a0 >= count )
657  {
658  PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
659  sipIsErr = 1;
660  }
661  else
662  {
663  std::unique_ptr< QgsPoint > p;
664  if ( a0 >= 0 )
665  p = qgis::make_unique< QgsPoint >( sipCpp->pointN( a0 ) );
666  else
667  p = qgis::make_unique< QgsPoint >( sipCpp->pointN( count + a0 ) );
668  sipRes = sipConvertFromType( p.release(), sipType_QgsPoint, Py_None );
669  }
670  % End
671 
680  void __setitem__( int index, const QgsPoint &point );
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  if ( a0 < 0 )
691  a0 = count + a0;
692  sipCpp->setXAt( a0, a1->x() );
693  sipCpp->setYAt( a0, a1->y() );
694  if ( sipCpp->isMeasure() )
695  sipCpp->setMAt( a0, a1->m() );
696  if ( sipCpp->is3D() )
697  sipCpp->setZAt( a0, a1->z() );
698  }
699  % End
700 
701 
710  void __delitem__( int index );
711  % MethodCode
712  const int count = sipCpp->numPoints();
713  if ( a0 >= 0 && a0 < count )
714  sipCpp->deleteVertex( QgsVertexId( -1, -1, a0 ) );
715  else if ( a0 < 0 && a0 >= -count )
716  sipCpp->deleteVertex( QgsVertexId( -1, -1, count + a0 ) );
717  else
718  {
719  PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
720  sipIsErr = 1;
721  }
722  % End
723 
724 #endif
725 
726  protected:
727 
728  QgsRectangle calculateBoundingBox() const override;
729 
730  private:
731  QVector<double> mX;
732  QVector<double> mY;
733  QVector<double> mZ;
734  QVector<double> mM;
735 
736  void importVerticesFromWkb( const QgsConstWkbPtr &wkb );
737 
743  void fromWkbPoints( QgsWkbTypes::Type type, const QgsConstWkbPtr &wkb )
744  {
745  mWkbType = type;
746  importVerticesFromWkb( wkb );
747  }
748 
749  friend class QgsPolygon;
750  friend class QgsTriangle;
751 
752 };
753 
754 // clazy:excludeall=qstring-allocations
755 
756 #endif // QGSLINESTRINGV2_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
virtual bool isEmpty() const
Returns true if the geometry is empty.
A rectangle specified with double values.
Definition: qgsrectangle.h:40
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 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.
virtual QByteArray asWkb() const =0
Returns a WKB representation of the geometry.
virtual bool insertVertex(QgsVertexId position, const QgsPoint &vertex)=0
Inserts a vertex into the geometry.
const double * zData() const
Returns a const pointer to the z vertex data, or a nullptr if the linestring does not have z values...
TransformDirection
Enum used to indicate the direction (forward or inverse) of the transform.
QgsWkbTypes::Type wkbType() const
Returns the WKB type of the geometry.
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 QString asJson(int precision=17) const =0
Returns a GeoJSON representation of the geometry.
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:206
virtual QgsRectangle calculateBoundingBox() const
Default calculator for the minimal bounding box for the geometry.
double mAt(int index) const
Returns the m value of the specified node in the line string.
virtual QgsPoint endPoint() const =0
Returns the end point of the curve.
Type
The WKB type describes the number of dimensions a geometry has.
Definition: qgswkbtypes.h:68
virtual int nCoordinates() const
Returns the number of nodes contained in the geometry.
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:119
virtual QPolygonF asQPolygonF() const
Returns a QPolygonF representing the points.
Definition: qgscurve.cpp:191
const QgsLineString * cast(const QgsAbstractGeometry *geom) const
Cast the geom to a QgsLineString.
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:69
Abstract base class for all geometries.
virtual int dimension() const =0
Returns the inherent dimension of the geometry.
const double * xData() const
Returns a const pointer to the x vertex data.
void setZAt(int index, double z)
Sets the z-coordinate of the specified node in the line string.
Point geometry type, with support for z-dimension and m-values.
Definition: qgspoint.h:37
AxisOrder
Axis order for GML generation.
Represents a single 2D line segment, consisting of a 2D start and end vertex only.
virtual double length() const
Returns the length of the geometry.
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:177
virtual void clear()=0
Clears the geometry, ie reset it to a null geometry.
double zAt(int index) const
Returns the z-coordinate of the specified node in the line string.
virtual QgsPoint centroid() const
Returns the centroid of the 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:51
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 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.
const double * mData() const
Returns a const pointer to the m vertex data, or a nullptr if the linestring does not have m values...
#define SIP_THROW(name)
Definition: qgis_sip.h:177
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
static Type flatType(Type type)
Returns the flat type for a WKB type.
Definition: qgswkbtypes.h:565
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.
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.
const double * yData() const
Returns a const pointer to the y vertex data.
virtual bool fromWkb(QgsConstWkbPtr &wkb)=0
Sets the geometry from a WKB string.