QGIS API Documentation  2.99.0-Master (13a3f2f)
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
QgsAbstractGeometry Class Referenceabstract

Abstract base class for all geometries. More...

#include <qgsabstractgeometry.h>

Inheritance diagram for QgsAbstractGeometry:
Inheritance graph
[legend]

Public Types

enum  SegmentationToleranceType { MaximumAngle = 0, MaximumDifference }
 Segmentation tolerance as maximum angle or maximum difference between approximation and circle. More...
 

Public Member Functions

 QgsAbstractGeometry ()
 
 QgsAbstractGeometry (const QgsAbstractGeometry &geom)
 
virtual ~QgsAbstractGeometry ()=default
 
virtual bool addMValue (double mValue=0)=0
 Adds a measure to the geometry, initialized to a preset value. More...
 
virtual bool addZValue (double zValue=0)=0
 Adds a z-dimension to the geometry, initialized to a preset value. More...
 
virtual double area () const
 Returns the area of the geometry. More...
 
virtual QDomElement asGML2 (QDomDocument &doc, int precision=17, const QString &ns="gml") const =0
 Returns a GML2 representation of the geometry. More...
 
virtual QDomElement asGML3 (QDomDocument &doc, int precision=17, const QString &ns="gml") const =0
 Returns a GML3 representation of the geometry. More...
 
virtual QString asJSON (int precision=17) const =0
 Returns a GeoJSON representation of the geometry. More...
 
virtual QByteArray asWkb () const =0
 Returns a WKB representation of the geometry. More...
 
virtual QString asWkt (int precision=17) const =0
 Returns a WKT representation of the geometry. More...
 
virtual QgsAbstractGeometryboundary () const =0
 Returns the closure of the combinatorial boundary of the geometry (ie the topological boundary of the geometry). More...
 
virtual QgsRectangle boundingBox () const =0
 Returns the minimal bounding box for the geometry. More...
 
virtual QgsPointV2 centroid () const
 Returns the centroid of the geometry. More...
 
virtual void clear ()=0
 Clears the geometry, ie reset it to a null geometry. More...
 
virtual QgsAbstractGeometryclone () const =0
 Clones the geometry by performing a deep copy. More...
 
virtual double closestSegment (const QgsPointV2 &pt, QgsPointV2 &segmentPt, QgsVertexId &vertexAfter, bool *leftOf, double epsilon) const =0
 Searches for the closest segment of the geometry to a given point. More...
 
virtual bool convertTo (QgsWkbTypes::Type type)
 Converts the geometry to a specified type. More...
 
virtual QgsCoordinateSequence coordinateSequence () const =0
 Retrieves the sequence of geometries, rings and nodes. More...
 
virtual bool deleteVertex (QgsVertexId position)=0
 Deletes a vertex within the geometry. More...
 
virtual int dimension () const =0
 Returns the inherent dimension of the geometry. More...
 
virtual void draw (QPainter &p) const =0
 Draws the geometry using the specified QPainter. More...
 
virtual bool dropMValue ()=0
 Drops any measure values which exist in the geometry. More...
 
virtual bool dropZValue ()=0
 Drops any z-dimensions which exist in the geometry. More...
 
virtual bool fromWkb (QgsConstWkbPtr &wkb)=0
 Sets the geometry from a WKB string. More...
 
virtual bool fromWkt (const QString &wkt)=0
 Sets the geometry from a WKT string. More...
 
virtual QString geometryType () const =0
 Returns a unique string representing the geometry type. More...
 
virtual bool hasCurvedSegments () const
 Returns true if the geometry contains curved segments. More...
 
virtual bool insertVertex (QgsVertexId position, const QgsPointV2 &vertex)=0
 Inserts a vertex into the geometry. More...
 
bool is3D () const
 Returns true if the geometry is 3D and contains a z-value. More...
 
virtual bool isEmpty () const
 Returns true if the geometry is empty. More...
 
bool isMeasure () const
 Returns true if the geometry contains m values. More...
 
virtual double length () const
 Returns the length of the geometry. More...
 
virtual bool moveVertex (QgsVertexId position, const QgsPointV2 &newPos)=0
 Moves a vertex within the geometry. More...
 
virtual int nCoordinates () const
 Returns the number of nodes contained in the geometry. More...
 
virtual bool nextVertex (QgsVertexId &id, QgsPointV2 &vertex) const =0
 Returns next vertex id and coordinates. More...
 
QgsAbstractGeometryoperator= (const QgsAbstractGeometry &geom)
 
virtual int partCount () const =0
 Returns count of parts contained in the geometry. More...
 
virtual double perimeter () const
 Returns the perimeter of the geometry. More...
 
virtual int ringCount (int part=0) const =0
 Returns the number of rings of which this geometry is built. More...
 
virtual QgsAbstractGeometrysegmentize (double tolerance=M_PI/180., SegmentationToleranceType toleranceType=MaximumAngle) const
 Returns a version of the geometry without curves. More...
 
virtual QgsAbstractGeometrytoCurveType () const
 Returns the geometry converted to the more generic curve type. More...
 
virtual void transform (const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d=QgsCoordinateTransform::ForwardTransform, bool transformZ=false)=0
 Transforms the geometry using a coordinate transform. More...
 
virtual void transform (const QTransform &t)=0
 Transforms the geometry using a QTransform object. More...
 
virtual double vertexAngle (QgsVertexId vertex) const =0
 Returns approximate angle at a vertex. More...
 
virtual QgsPointV2 vertexAt (QgsVertexId id) const =0
 Returns the point corresponding to a specified vertex id. More...
 
virtual int vertexCount (int part=0, int ring=0) const =0
 Returns the number of vertexes of which this geometry is built. More...
 
QgsWkbTypes::Type wkbType () const
 Returns the WKB type of the geometry. More...
 
QString wktTypeStr () const
 Returns the WKT type string of the geometry. More...
 

Protected Member Functions

virtual QgsRectangle calculateBoundingBox () const
 Default calculator for the minimal bounding box for the geometry. More...
 
virtual void clearCache () const
 Clears any cached parameters associated with the geometry, e.g., bounding boxes. More...
 
void setZMTypeFromSubGeometry (const QgsAbstractGeometry *subggeom, QgsWkbTypes::Type baseGeomType)
 Updates the geometry type based on whether sub geometries contain z or m values. More...
 

Protected Attributes

QgsWkbTypes::Type mWkbType
 

Detailed Description

Abstract base class for all geometries.

Since
QGIS 2.10

Definition at line 51 of file qgsabstractgeometry.h.

Member Enumeration Documentation

◆ SegmentationToleranceType

Segmentation tolerance as maximum angle or maximum difference between approximation and circle.

Enumerator
MaximumAngle 
MaximumDifference 

Definition at line 89 of file qgsabstractgeometry.h.

Constructor & Destructor Documentation

◆ QgsAbstractGeometry() [1/2]

QgsAbstractGeometry::QgsAbstractGeometry ( )

Definition at line 26 of file qgsabstractgeometry.cpp.

◆ ~QgsAbstractGeometry()

virtual QgsAbstractGeometry::~QgsAbstractGeometry ( )
virtualdefault

◆ QgsAbstractGeometry() [2/2]

QgsAbstractGeometry::QgsAbstractGeometry ( const QgsAbstractGeometry geom)

Definition at line 30 of file qgsabstractgeometry.cpp.

Member Function Documentation

◆ addMValue()

virtual bool QgsAbstractGeometry::addMValue ( double  mValue = 0)
pure virtual

Adds a measure to the geometry, initialized to a preset value.

Parameters
mValueinitial m-value for all nodes
Returns
true on success
Since
QGIS 2.12
See also
dropMValue()
addZValue()

Implemented in QgsPointV2, QgsLineString, QgsCurvePolygon, QgsGeometryCollection, QgsCompoundCurve, and QgsCircularString.

◆ addZValue()

virtual bool QgsAbstractGeometry::addZValue ( double  zValue = 0)
pure virtual

Adds a z-dimension to the geometry, initialized to a preset value.

Parameters
zValueinitial z-value for all nodes
Returns
true on success
Since
QGIS 2.12
See also
dropZValue()
addMValue()

Implemented in QgsPointV2, QgsLineString, QgsCurvePolygon, QgsGeometryCollection, QgsCompoundCurve, and QgsCircularString.

◆ area()

double QgsAbstractGeometry::area ( ) const
virtual

Returns the area of the geometry.

See also
length()
perimeter()

Reimplemented in QgsGeometryCollection, and QgsCurvePolygon.

Definition at line 154 of file qgsabstractgeometry.cpp.

◆ asGML2()

virtual QDomElement QgsAbstractGeometry::asGML2 ( QDomDocument &  doc,
int  precision = 17,
const QString &  ns = "gml" 
) const
pure virtual

Returns a GML2 representation of the geometry.

Parameters
docDOM document
precisionnumber of decimal places for coordinates
nsXML namespace
See also
asWkb
asWkt
asGML3
asJSON

Implemented in QgsPointV2, QgsLineString, QgsGeometryCollection, QgsCircularString, QgsCompoundCurve, QgsCurvePolygon, QgsMultiCurve, QgsMultiLineString, QgsMultiPointV2, QgsMultiPolygonV2, and QgsMultiSurface.

◆ asGML3()

virtual QDomElement QgsAbstractGeometry::asGML3 ( QDomDocument &  doc,
int  precision = 17,
const QString &  ns = "gml" 
) const
pure virtual

Returns a GML3 representation of the geometry.

Parameters
docDOM document
precisionnumber of decimal places for coordinates
nsXML namespace
See also
asWkb
asWkt
asGML2
asJSON

Implemented in QgsPointV2, QgsLineString, QgsGeometryCollection, QgsCircularString, QgsCompoundCurve, QgsCurvePolygon, QgsMultiCurve, QgsMultiLineString, QgsMultiPointV2, QgsMultiPolygonV2, and QgsMultiSurface.

◆ asJSON()

virtual QString QgsAbstractGeometry::asJSON ( int  precision = 17) const
pure virtual

Returns a GeoJSON representation of the geometry.

Parameters
precisionnumber of decimal places for coordinates
See also
asWkb
asWkt
asGML2
asGML3

Implemented in QgsPointV2, QgsLineString, QgsGeometryCollection, QgsCircularString, QgsCompoundCurve, QgsCurvePolygon, QgsMultiCurve, QgsMultiLineString, QgsMultiPointV2, QgsMultiPolygonV2, and QgsMultiSurface.

◆ asWkb()

virtual QByteArray QgsAbstractGeometry::asWkb ( ) const
pure virtual

Returns a WKB representation of the geometry.

See also
asWkt
asGML2
asGML3
asJSON
Since
QGIS 3.0

Implemented in QgsPointV2, QgsLineString, QgsGeometryCollection, QgsCircularString, QgsCompoundCurve, QgsCurvePolygon, and QgsPolygonV2.

◆ asWkt()

virtual QString QgsAbstractGeometry::asWkt ( int  precision = 17) const
pure virtual

Returns a WKT representation of the geometry.

Parameters
precisionnumber of decimal places for coordinates
See also
asWkb
asGML2
asGML3
asJSON

Implemented in QgsPointV2, QgsLineString, QgsGeometryCollection, QgsCircularString, QgsCompoundCurve, and QgsCurvePolygon.

◆ boundary()

virtual QgsAbstractGeometry* QgsAbstractGeometry::boundary ( ) const
pure virtual

Returns the closure of the combinatorial boundary of the geometry (ie the topological boundary of the geometry).

For instance, a polygon geometry will have a boundary consisting of the linestrings for each ring in the polygon.

Returns
boundary for geometry. May be null for some geometry types.
Since
QGIS 3.0

Implemented in QgsPointV2, QgsCurve, QgsTriangle, QgsGeometryCollection, QgsPolygonV2, QgsCurvePolygon, QgsMultiCurve, QgsMultiPolygonV2, QgsMultiPointV2, and QgsMultiSurface.

◆ boundingBox()

virtual QgsRectangle QgsAbstractGeometry::boundingBox ( ) const
pure virtual

Returns the minimal bounding box for the geometry.

Implemented in QgsPointV2, QgsCurve, QgsGeometryCollection, and QgsSurface.

◆ calculateBoundingBox()

QgsRectangle QgsAbstractGeometry::calculateBoundingBox ( ) const
protectedvirtual

Default calculator for the minimal bounding box for the geometry.

Derived classes should override this method if a more efficient bounding box calculation is available.

Reimplemented in QgsLineString, QgsGeometryCollection, QgsCurvePolygon, QgsCompoundCurve, and QgsCircularString.

Definition at line 98 of file qgsabstractgeometry.cpp.

◆ centroid()

QgsPointV2 QgsAbstractGeometry::centroid ( ) const
virtual

Returns the centroid of the geometry.

Reimplemented in QgsLineString.

Definition at line 169 of file qgsabstractgeometry.cpp.

◆ clear()

virtual void QgsAbstractGeometry::clear ( )
pure virtual

Clears the geometry, ie reset it to a null geometry.

Implemented in QgsPointV2, QgsLineString, QgsTriangle, QgsGeometryCollection, QgsCircularString, QgsCompoundCurve, QgsCurvePolygon, and QgsPolygonV2.

◆ clearCache()

void QgsAbstractGeometry::clearCache ( ) const
protectedvirtual

Clears any cached parameters associated with the geometry, e.g., bounding boxes.

Reimplemented in QgsGeometryCollection, QgsCurve, and QgsSurface.

Definition at line 125 of file qgsabstractgeometry.cpp.

◆ clone()

virtual QgsAbstractGeometry* QgsAbstractGeometry::clone ( ) const
pure virtual

◆ closestSegment()

virtual double QgsAbstractGeometry::closestSegment ( const QgsPointV2 pt,
QgsPointV2 segmentPt,
QgsVertexId vertexAfter,
bool *  leftOf,
double  epsilon 
) const
pure virtual

Searches for the closest segment of the geometry to a given point.

Parameters
ptspecifies the point to find closest segment to
segmentPtstorage for the closest point within the geometry
vertexAfterstorage for the ID of the vertex at the end of the closest segment
leftOfreturns whether the point lies on the left side of the nearest segment (true if point is to left of segment, false if point is to right of segment)
epsilonepsilon for segment snapping
Returns
squared distance to closest segment or negative value on error

Implemented in QgsPointV2, QgsLineString, QgsCurvePolygon, QgsCompoundCurve, QgsGeometryCollection, and QgsCircularString.

◆ convertTo()

bool QgsAbstractGeometry::convertTo ( QgsWkbTypes::Type  type)
virtual

Converts the geometry to a specified type.

Returns
true if conversion was successful
Since
QGIS 2.14

Reimplemented in QgsPointV2, and QgsLineString.

Definition at line 221 of file qgsabstractgeometry.cpp.

◆ coordinateSequence()

virtual QgsCoordinateSequence QgsAbstractGeometry::coordinateSequence ( ) const
pure virtual

Retrieves the sequence of geometries, rings and nodes.

Returns
coordinate sequence

Implemented in QgsPointV2, QgsCurvePolygon, QgsGeometryCollection, and QgsCurve.

◆ deleteVertex()

virtual bool QgsAbstractGeometry::deleteVertex ( QgsVertexId  position)
pure virtual

Deletes a vertex within the geometry.

Parameters
positionvertex id for vertex to delete
Returns
true if delete was successful
See also
insertVertex
moveVertex

Implemented in QgsPointV2, QgsLineString, QgsCurvePolygon, QgsGeometryCollection, QgsCompoundCurve, QgsTriangle, and QgsCircularString.

◆ dimension()

virtual int QgsAbstractGeometry::dimension ( ) const
pure virtual

Returns the inherent dimension of the geometry.

For example, this is 0 for a point geometry, 1 for a linestring and 2 for a polygon.

Implemented in QgsPointV2, QgsLineString, QgsGeometryCollection, QgsCircularString, QgsCompoundCurve, and QgsCurvePolygon.

◆ draw()

virtual void QgsAbstractGeometry::draw ( QPainter &  p) const
pure virtual

Draws the geometry using the specified QPainter.

Parameters
pdestination QPainter

Implemented in QgsPointV2, QgsLineString, QgsCurvePolygon, QgsCompoundCurve, QgsGeometryCollection, and QgsCircularString.

◆ dropMValue()

virtual bool QgsAbstractGeometry::dropMValue ( )
pure virtual

Drops any measure values which exist in the geometry.

Returns
true if m-values were present and have been removed
See also
addMValue()
dropZValue()
Since
QGIS 2.14

Implemented in QgsPointV2, QgsLineString, QgsCurvePolygon, QgsGeometryCollection, QgsCompoundCurve, and QgsCircularString.

◆ dropZValue()

virtual bool QgsAbstractGeometry::dropZValue ( )
pure virtual

Drops any z-dimensions which exist in the geometry.

Returns
true if Z values were present and have been removed
See also
addZValue()
dropMValue()
Since
QGIS 2.14

Implemented in QgsPointV2, QgsLineString, QgsCurvePolygon, QgsGeometryCollection, QgsCompoundCurve, and QgsCircularString.

◆ fromWkb()

virtual bool QgsAbstractGeometry::fromWkb ( QgsConstWkbPtr wkb)
pure virtual

Sets the geometry from a WKB string.

After successful read the wkb argument will be at the position where the reading has stopped.

See also
fromWkt

Implemented in QgsPointV2, QgsLineString, QgsGeometryCollection, QgsTriangle, QgsCircularString, QgsCompoundCurve, QgsCurvePolygon, and QgsPolygonV2.

◆ fromWkt()

virtual bool QgsAbstractGeometry::fromWkt ( const QString &  wkt)
pure virtual

◆ geometryType()

virtual QString QgsAbstractGeometry::geometryType ( ) const
pure virtual

◆ hasCurvedSegments()

bool QgsAbstractGeometry::hasCurvedSegments ( ) const
virtual

Returns true if the geometry contains curved segments.

Reimplemented in QgsCurvePolygon, QgsGeometryCollection, QgsCompoundCurve, and QgsCircularString.

Definition at line 259 of file qgsabstractgeometry.cpp.

◆ insertVertex()

virtual bool QgsAbstractGeometry::insertVertex ( QgsVertexId  position,
const QgsPointV2 vertex 
)
pure virtual

Inserts a vertex into the geometry.

Parameters
positionvertex id for position of inserted vertex
vertexvertex to insert
Returns
true if insert was successful
See also
moveVertex
deleteVertex

Implemented in QgsPointV2, QgsLineString, QgsCurvePolygon, QgsGeometryCollection, QgsCompoundCurve, QgsTriangle, and QgsCircularString.

◆ is3D()

bool QgsAbstractGeometry::is3D ( ) const

Returns true if the geometry is 3D and contains a z-value.

See also
isMeasure

Definition at line 45 of file qgsabstractgeometry.cpp.

◆ isEmpty()

bool QgsAbstractGeometry::isEmpty ( ) const
virtual

Returns true if the geometry is empty.

Reimplemented in QgsPointV2, QgsLineString, QgsCurvePolygon, QgsCompoundCurve, QgsGeometryCollection, and QgsCircularString.

Definition at line 252 of file qgsabstractgeometry.cpp.

◆ isMeasure()

bool QgsAbstractGeometry::isMeasure ( ) const

Returns true if the geometry contains m values.

See also
is3D

Definition at line 50 of file qgsabstractgeometry.cpp.

◆ length()

double QgsAbstractGeometry::length ( ) const
virtual

Returns the length of the geometry.

See also
area()
perimeter()

Reimplemented in QgsLineString, QgsGeometryCollection, QgsCircularString, and QgsCompoundCurve.

Definition at line 144 of file qgsabstractgeometry.cpp.

◆ moveVertex()

virtual bool QgsAbstractGeometry::moveVertex ( QgsVertexId  position,
const QgsPointV2 newPos 
)
pure virtual

Moves a vertex within the geometry.

Parameters
positionvertex id for vertex to move
newPosnew position of vertex
Returns
true if move was successful
See also
insertVertex
deleteVertex

Implemented in QgsPointV2, QgsLineString, QgsCurvePolygon, QgsGeometryCollection, QgsCompoundCurve, QgsTriangle, and QgsCircularString.

◆ nCoordinates()

int QgsAbstractGeometry::nCoordinates ( ) const
virtual

Returns the number of nodes contained in the geometry.

Reimplemented in QgsPointV2, QgsLineString, QgsCurvePolygon, QgsGeometryCollection, and QgsMultiPointV2.

Definition at line 129 of file qgsabstractgeometry.cpp.

◆ nextVertex()

virtual bool QgsAbstractGeometry::nextVertex ( QgsVertexId id,
QgsPointV2 vertex 
) const
pure virtual

Returns next vertex id and coordinates.

Parameters
idinitial value should be the starting vertex id. The next vertex id will be stored in this variable if found.
vertexcontainer for found node
Returns
false if at end

Implemented in QgsPointV2, QgsCurvePolygon, QgsGeometryCollection, and QgsCurve.

◆ operator=()

QgsAbstractGeometry & QgsAbstractGeometry::operator= ( const QgsAbstractGeometry geom)

Definition at line 35 of file qgsabstractgeometry.cpp.

◆ partCount()

virtual int QgsAbstractGeometry::partCount ( ) const
pure virtual

Returns count of parts contained in the geometry.

See also
vertexCount
ringCount

Implemented in QgsPointV2, QgsCurvePolygon, QgsGeometryCollection, and QgsCurve.

◆ perimeter()

double QgsAbstractGeometry::perimeter ( ) const
virtual

Returns the perimeter of the geometry.

See also
area()
length()

Reimplemented in QgsGeometryCollection, and QgsCurvePolygon.

Definition at line 149 of file qgsabstractgeometry.cpp.

◆ ringCount()

virtual int QgsAbstractGeometry::ringCount ( int  part = 0) const
pure virtual

Returns the number of rings of which this geometry is built.

Implemented in QgsPointV2, QgsCurvePolygon, QgsGeometryCollection, and QgsCurve.

◆ segmentize()

QgsAbstractGeometry * QgsAbstractGeometry::segmentize ( double  tolerance = M_PI / 180.,
SegmentationToleranceType  toleranceType = MaximumAngle 
) const
virtual

Returns a version of the geometry without curves.

Caller takes ownership of the returned geometry.

Parameters
tolerancesegmentation tolerance
toleranceTypemaximum segmentation angle or maximum difference between approximation and curve

Reimplemented in QgsCurvePolygon, QgsGeometryCollection, and QgsCurve.

Definition at line 265 of file qgsabstractgeometry.cpp.

◆ setZMTypeFromSubGeometry()

void QgsAbstractGeometry::setZMTypeFromSubGeometry ( const QgsAbstractGeometry subggeom,
QgsWkbTypes::Type  baseGeomType 
)
protected

Updates the geometry type based on whether sub geometries contain z or m values.

Definition at line 56 of file qgsabstractgeometry.cpp.

◆ toCurveType()

QgsAbstractGeometry * QgsAbstractGeometry::toCurveType ( ) const
virtual

Returns the geometry converted to the more generic curve type.

E.g. QgsLineString -> QgsCompoundCurve, QgsPolygonV2 -> QgsCurvePolygon, QgsMultiLineString -> QgsMultiCurve, QgsMultiPolygonV2 -> QgsMultiSurface

Returns
the converted geometry. Caller takes ownership

Reimplemented in QgsLineString, QgsTriangle, QgsPolygonV2, QgsMultiLineString, and QgsMultiPolygonV2.

Definition at line 272 of file qgsabstractgeometry.cpp.

◆ transform() [1/2]

virtual void QgsAbstractGeometry::transform ( const QgsCoordinateTransform ct,
QgsCoordinateTransform::TransformDirection  d = QgsCoordinateTransform::ForwardTransform,
bool  transformZ = false 
)
pure virtual

Transforms the geometry using a coordinate transform.

Parameters
ctcoordinate transform
dtransformation direction
transformZset to true to also transform z coordinates. This requires that the z coordinates in the geometry represent height relative to the vertical datum of the source CRS (generally ellipsoidal heights) and are expressed in its vertical units (generally meters). If false, then z coordinates will not be changed by the transform.

Implemented in QgsPointV2, QgsLineString, QgsCurvePolygon, QgsCompoundCurve, QgsGeometryCollection, and QgsCircularString.

◆ transform() [2/2]

virtual void QgsAbstractGeometry::transform ( const QTransform &  t)
pure virtual

Transforms the geometry using a QTransform object.

Parameters
tQTransform transformation

Implemented in QgsPointV2, QgsLineString, QgsCurvePolygon, QgsCompoundCurve, QgsGeometryCollection, and QgsCircularString.

◆ vertexAngle()

virtual double QgsAbstractGeometry::vertexAngle ( QgsVertexId  vertex) const
pure virtual

Returns approximate angle at a vertex.

This is usually the average angle between adjacent segments, and can be pictured as the orientation of a line following the curvature of the geometry at the specified vertex.

Parameters
vertexthe vertex id
Returns
rotation in radians, clockwise from north

Implemented in QgsPointV2, QgsLineString, QgsCurvePolygon, QgsGeometryCollection, QgsCompoundCurve, and QgsCircularString.

◆ vertexAt()

virtual QgsPointV2 QgsAbstractGeometry::vertexAt ( QgsVertexId  id) const
pure virtual

Returns the point corresponding to a specified vertex id.

Implemented in QgsPointV2, QgsCurvePolygon, QgsGeometryCollection, and QgsCurve.

◆ vertexCount()

virtual int QgsAbstractGeometry::vertexCount ( int  part = 0,
int  ring = 0 
) const
pure virtual

Returns the number of vertexes of which this geometry is built.

Implemented in QgsPointV2, QgsCurvePolygon, QgsGeometryCollection, and QgsCurve.

◆ wkbType()

QgsWkbTypes::Type QgsAbstractGeometry::wkbType ( ) const
inline

Returns the WKB type of the geometry.

See also
geometryType
wktTypeStr

Definition at line 129 of file qgsabstractgeometry.h.

◆ wktTypeStr()

QString QgsAbstractGeometry::wktTypeStr ( ) const

Returns the WKT type string of the geometry.

See also
geometryType
wkbType

Definition at line 159 of file qgsabstractgeometry.cpp.

Member Data Documentation

◆ mWkbType

QgsWkbTypes::Type QgsAbstractGeometry::mWkbType
protected

Definition at line 412 of file qgsabstractgeometry.h.


The documentation for this class was generated from the following files: