QGIS API Documentation  2.18.3-Las Palmas (77b8c3d)
Public Member Functions | Protected Member Functions | Friends | List of all members
QgsLineStringV2 Class Reference

Line string geometry type, with support for z-dimension and m-values. More...

#include <qgslinestringv2.h>

Inheritance diagram for QgsLineStringV2:
Inheritance graph
[legend]

Public Member Functions

 QgsLineStringV2 ()
 
 ~QgsLineStringV2 ()
 
virtual bool addMValue (double mValue=0) override
 Adds a measure to the geometry, initialized to a preset value. More...
 
void addToPainterPath (QPainterPath &path) const override
 Adds a curve to a painter path. More...
 
void addVertex (const QgsPointV2 &pt)
 Adds a new vertex to the end of the line string. More...
 
virtual bool addZValue (double zValue=0) override
 Adds a z-dimension to the geometry, initialized to a preset value. More...
 
void append (const QgsLineStringV2 *line)
 Appends the contents of another line string to the end of this line string. More...
 
QDomElement asGML2 (QDomDocument &doc, int precision=17, const QString &ns="gml") const override
 Returns a GML2 representation of the geometry. More...
 
QDomElement asGML3 (QDomDocument &doc, int precision=17, const QString &ns="gml") const override
 Returns a GML3 representation of the geometry. More...
 
QString asJSON (int precision=17) const override
 Returns a GeoJSON representation of the geometry. More...
 
QPolygonF asQPolygonF () const
 Returns a QPolygonF representing the line string. More...
 
unsigned char * asWkb (int &binarySize) const override
 Returns a WKB representation of the geometry. More...
 
QString asWkt (int precision=17) const override
 Returns a WKT representation of the geometry. More...
 
virtual QgsPointV2 centroid () const override
 Returns the centroid of the geometry. More...
 
virtual void clear () override
 Clears the geometry, ie reset it to a null geometry. More...
 
virtual QgsLineStringV2clone () const override
 Clones the geometry by performing a deep copy. More...
 
void close ()
 Closes the line string by appending the first point to the end of the line, if it is not already closed. More...
 
double closestSegment (const QgsPointV2 &pt, QgsPointV2 &segmentPt, QgsVertexId &vertexAfter, bool *leftOf, double epsilon) const override
 Searches for the closest segment of the geometry to a given point. More...
 
bool convertTo (QgsWKBTypes::Type type) override
 Converts the geometry to a specified type. More...
 
virtual QgsLineStringV2curveToLine (double tolerance=M_PI_2/90, SegmentationToleranceType toleranceType=MaximumAngle) const override
 Returns a new line string geometry corresponding to a segmentized approximation of the curve. More...
 
virtual bool deleteVertex (QgsVertexId position) override
 Deletes a vertex within the geometry. More...
 
virtual int dimension () const override
 Returns the inherent dimension of the geometry. More...
 
void draw (QPainter &p) const override
 Draws the geometry using the specified QPainter. More...
 
void drawAsPolygon (QPainter &p) const override
 Draws the curve as a polygon on the specified QPainter. More...
 
virtual bool dropMValue () override
 Drops any measure values which exist in the geometry. More...
 
virtual bool dropZValue () override
 Drops any z-dimensions which exist in the geometry. More...
 
virtual QgsPointV2 endPoint () const override
 Returns the end point of the curve. More...
 
virtual bool fromWkb (QgsConstWkbPtr wkb) override
 Sets the geometry from a WKB string. More...
 
virtual bool fromWkt (const QString &wkt) override
 Sets the geometry from a WKT string. More...
 
virtual QString geometryType () const override
 Returns a unique string representing the geometry type. More...
 
virtual bool insertVertex (QgsVertexId position, const QgsPointV2 &vertex) override
 Inserts a vertex into the geometry. More...
 
virtual double length () const override
 Returns the length of the geometry. More...
 
double mAt (int index) const
 Returns the m value of the specified node in the line string. More...
 
virtual bool moveVertex (QgsVertexId position, const QgsPointV2 &newPos) override
 Moves a vertex within the geometry. More...
 
virtual int nCoordinates () const override
 Returns the number of nodes contained in the geometry. More...
 
int numPoints () const override
 Returns the number of points in the curve. More...
 
bool operator!= (const QgsCurveV2 &other) const override
 
bool operator== (const QgsCurveV2 &other) const override
 
bool pointAt (int node, QgsPointV2 &point, QgsVertexId::VertexType &type) const override
 Returns the point and vertex id of a point within the curve. More...
 
QgsPointV2 pointN (int i) const
 Returns the specified point from inside the line string. More...
 
void points (QgsPointSequenceV2 &pt) const override
 Returns a list of points within the curve. More...
 
virtual QgsLineStringV2reversed () const override
 Returns a reversed copy of the curve, where the direction of the curve has been flipped. More...
 
void setMAt (int index, double m)
 Sets the m value of the specified node in the line string. More...
 
void setPoints (const QgsPointSequenceV2 &points)
 Resets the line string to match the specified list of points. More...
 
void setXAt (int index, double x)
 Sets the x-coordinate of the specified node in the line string. More...
 
void setYAt (int index, double y)
 Sets the y-coordinate of the specified node in the line string. More...
 
void setZAt (int index, double z)
 Sets the z-coordinate of the specified node in the line string. More...
 
virtual QgsPointV2 startPoint () const override
 Returns the starting point of the curve. More...
 
void sumUpArea (double &sum) const override
 Calculates the area of the curve. More...
 
QgsAbstractGeometryV2toCurveType () const override
 Returns the geometry converted to the more generic curve type QgsCompoundCurveV2. More...
 
void transform (const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d=QgsCoordinateTransform::ForwardTransform, bool transformZ=false) override
 Transforms the geometry using a coordinate transform. More...
 
void transform (const QTransform &t) override
 Transforms the geometry using a QTransform object. More...
 
double vertexAngle (QgsVertexId vertex) const override
 Returns approximate angle at a vertex. More...
 
int wkbSize () const override
 Returns the size of the WKB representation of the geometry. More...
 
double xAt (int index) const
 Returns the x-coordinate of the specified node in the line string. More...
 
double yAt (int index) const
 Returns the y-coordinate of the specified node in the line string. More...
 
double zAt (int index) const
 Returns the z-coordinate of the specified node in the line string. More...
 
- Public Member Functions inherited from QgsCurveV2
 QgsCurveV2 ()
 
virtual ~QgsCurveV2 ()
 
virtual QgsAbstractGeometryV2boundary () const override
 Returns the closure of the combinatorial boundary of the geometry (ie the topological boundary of the geometry). More...
 
virtual QgsRectangle boundingBox () const override
 Returns the minimal bounding box for the geometry. More...
 
virtual QgsCoordinateSequenceV2 coordinateSequence () const override
 Retrieves the sequence of geometries, rings and nodes. More...
 
virtual bool isClosed () const
 Returns true if the curve is closed. More...
 
virtual bool isRing () const
 Returns true if the curve is a ring. More...
 
virtual bool nextVertex (QgsVertexId &id, QgsPointV2 &vertex) const override
 Returns next vertex id and coordinates. More...
 
virtual int partCount () const override
 Returns count of parts contained in the geometry. More...
 
virtual int ringCount (int part=0) const override
 
QgsCurveV2segmentize (double tolerance=M_PI_2/90, SegmentationToleranceType toleranceType=MaximumAngle) const override
 Returns a geometry without curves. More...
 
virtual QgsPointV2 vertexAt (QgsVertexId id) const override
 Returns the point corresponding to a specified vertex id. More...
 
virtual int vertexCount (int part=0, int ring=0) const override
 
- Public Member Functions inherited from QgsAbstractGeometryV2
 QgsAbstractGeometryV2 ()
 
 QgsAbstractGeometryV2 (const QgsAbstractGeometryV2 &geom)
 
virtual ~QgsAbstractGeometryV2 ()
 
virtual double area () const
 Returns the area of the geometry. More...
 
virtual bool hasCurvedSegments () const
 Returns true if the geometry contains curved segments. More...
 
bool is3D () const
 Returns true if the geometry is 3D and contains a z-value. More...
 
bool isEmpty () const
 Returns true if the geometry is empty. More...
 
bool isMeasure () const
 Returns true if the geometry contains m values. More...
 
virtual QgsAbstractGeometryV2operator= (const QgsAbstractGeometryV2 &geom)
 
virtual double perimeter () const
 Returns the perimeter of the geometry. 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 override
 Default calculator for the minimal bounding box for the geometry. More...
 
- Protected Member Functions inherited from QgsCurveV2
virtual void clearCache () const override
 Clears any cached parameters associated with the geometry, eg bounding boxes. More...
 
- Protected Member Functions inherited from QgsAbstractGeometryV2
void setZMTypeFromSubGeometry (const QgsAbstractGeometryV2 *subggeom, QgsWKBTypes::Type baseGeomType)
 Updates the geometry type based on whether sub geometries contain z or m values. More...
 

Friends

class QgsPolygonV2
 

Additional Inherited Members

- Public Types inherited from QgsAbstractGeometryV2
enum  SegmentationToleranceType { MaximumAngle = 0, MaximumDifference }
 Segmentation tolerance as maximum angle or maximum difference between approximation and circle. More...
 
- Protected Attributes inherited from QgsAbstractGeometryV2
QgsWKBTypes::Type mWkbType
 

Detailed Description

Line string geometry type, with support for z-dimension and m-values.

Note
added in QGIS 2.10

Definition at line 36 of file qgslinestringv2.h.

Constructor & Destructor Documentation

QgsLineStringV2::QgsLineStringV2 ( )

Definition at line 38 of file qgslinestringv2.cpp.

QgsLineStringV2::~QgsLineStringV2 ( )

Definition at line 43 of file qgslinestringv2.cpp.

Member Function Documentation

bool QgsLineStringV2::addMValue ( double  mValue = 0)
overridevirtual

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

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

Implements QgsAbstractGeometryV2.

Definition at line 966 of file qgslinestringv2.cpp.

void QgsLineStringV2::addToPainterPath ( QPainterPath path) const
overridevirtual

Adds a curve to a painter path.

Implements QgsCurveV2.

Definition at line 555 of file qgslinestringv2.cpp.

void QgsLineStringV2::addVertex ( const QgsPointV2 pt)

Adds a new vertex to the end of the line string.

Parameters
ptvertex to add

Definition at line 723 of file qgslinestringv2.cpp.

bool QgsLineStringV2::addZValue ( double  zValue = 0)
overridevirtual

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

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

Implements QgsAbstractGeometryV2.

Definition at line 942 of file qgslinestringv2.cpp.

void QgsLineStringV2::append ( const QgsLineStringV2 line)

Appends the contents of another line string to the end of this line string.

Parameters
lineline to append. Ownership is not transferred.

Definition at line 466 of file qgslinestringv2.cpp.

QDomElement QgsLineStringV2::asGML2 ( QDomDocument doc,
int  precision = 17,
const QString ns = "gml" 
) const
overridevirtual

Returns a GML2 representation of the geometry.

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

Implements QgsAbstractGeometryV2.

Definition at line 196 of file qgslinestringv2.cpp.

QDomElement QgsLineStringV2::asGML3 ( QDomDocument doc,
int  precision = 17,
const QString ns = "gml" 
) const
overridevirtual

Returns a GML3 representation of the geometry.

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

Implements QgsAbstractGeometryV2.

Definition at line 207 of file qgslinestringv2.cpp.

QString QgsLineStringV2::asJSON ( int  precision = 17) const
overridevirtual

Returns a GeoJSON representation of the geometry.

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

Implements QgsAbstractGeometryV2.

Definition at line 222 of file qgslinestringv2.cpp.

QPolygonF QgsLineStringV2::asQPolygonF ( ) const

Returns a QPolygonF representing the line string.

Definition at line 579 of file qgslinestringv2.cpp.

unsigned char * QgsLineStringV2::asWkb ( int &  binarySize) const
overridevirtual

Returns a WKB representation of the geometry.

Parameters
binarySizewill be set to the size of the returned WKB string
See also
wkbSize
asWkt
asGML2
asGML3
asJSON

Implements QgsAbstractGeometryV2.

Definition at line 168 of file qgslinestringv2.cpp.

QString QgsLineStringV2::asWkt ( int  precision = 17) const
overridevirtual

Returns a WKT representation of the geometry.

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

Implements QgsAbstractGeometryV2.

Definition at line 187 of file qgslinestringv2.cpp.

QgsRectangle QgsLineStringV2::calculateBoundingBox ( ) const
overrideprotectedvirtual

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 from QgsAbstractGeometryV2.

Definition at line 117 of file qgslinestringv2.cpp.

QgsPointV2 QgsLineStringV2::centroid ( ) const
overridevirtual

Returns the centroid of the geometry.

Reimplemented from QgsAbstractGeometryV2.

Definition at line 796 of file qgslinestringv2.cpp.

void QgsLineStringV2::clear ( )
overridevirtual

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

Implements QgsAbstractGeometryV2.

Definition at line 84 of file qgslinestringv2.cpp.

QgsLineStringV2 * QgsLineStringV2::clone ( ) const
overridevirtual

Clones the geometry by performing a deep copy.

Implements QgsCurveV2.

Definition at line 79 of file qgslinestringv2.cpp.

void QgsLineStringV2::close ( )

Closes the line string by appending the first point to the end of the line, if it is not already closed.

Definition at line 884 of file qgslinestringv2.cpp.

double QgsLineStringV2::closestSegment ( const QgsPointV2 pt,
QgsPointV2 segmentPt,
QgsVertexId vertexAfter,
bool *  leftOf,
double  epsilon 
) const
overridevirtual

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

Implements QgsAbstractGeometryV2.

Definition at line 743 of file qgslinestringv2.cpp.

bool QgsLineStringV2::convertTo ( QgsWKBTypes::Type  type)
overridevirtual

Converts the geometry to a specified type.

Returns
true if conversion was successful
Note
added in QGIS 2.14

Reimplemented from QgsAbstractGeometryV2.

Definition at line 1019 of file qgslinestringv2.cpp.

QgsLineStringV2 * QgsLineStringV2::curveToLine ( double  tolerance = M_PI_2 / 90,
SegmentationToleranceType  toleranceType = MaximumAngle 
) const
overridevirtual

Returns a new line string geometry corresponding to a segmentized approximation of the curve.

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

Implements QgsCurveV2.

Definition at line 274 of file qgslinestringv2.cpp.

bool QgsLineStringV2::deleteVertex ( QgsVertexId  position)
overridevirtual

Deletes a vertex within the geometry.

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

Implements QgsAbstractGeometryV2.

Definition at line 690 of file qgslinestringv2.cpp.

virtual int QgsLineStringV2::dimension ( ) const
inlineoverridevirtual

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.

Implements QgsAbstractGeometryV2.

Definition at line 142 of file qgslinestringv2.h.

void QgsLineStringV2::draw ( QPainter p) const
overridevirtual

Draws the geometry using the specified QPainter.

Parameters
pdestination QPainter

Implements QgsAbstractGeometryV2.

Definition at line 550 of file qgslinestringv2.cpp.

void QgsLineStringV2::drawAsPolygon ( QPainter p) const
overridevirtual

Draws the curve as a polygon on the specified QPainter.

Parameters
pdestination QPainter

Implements QgsCurveV2.

Definition at line 574 of file qgslinestringv2.cpp.

bool QgsLineStringV2::dropMValue ( )
overridevirtual

Drops any measure values which exist in the geometry.

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

Implements QgsAbstractGeometryV2.

Definition at line 1008 of file qgslinestringv2.cpp.

bool QgsLineStringV2::dropZValue ( )
overridevirtual

Drops any z-dimensions which exist in the geometry.

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

Implements QgsAbstractGeometryV2.

Definition at line 997 of file qgslinestringv2.cpp.

QgsPointV2 QgsLineStringV2::endPoint ( ) const
overridevirtual

Returns the end point of the curve.

See also
startPoint

Implements QgsCurveV2.

Definition at line 259 of file qgslinestringv2.cpp.

bool QgsLineStringV2::fromWkb ( QgsConstWkbPtr  wkb)
overridevirtual

Sets the geometry from a WKB string.

See also
fromWkt

Implements QgsAbstractGeometryV2.

Definition at line 94 of file qgslinestringv2.cpp.

bool QgsLineStringV2::fromWkt ( const QString wkt)
overridevirtual

Sets the geometry from a WKT string.

See also
fromWkb

Implements QgsAbstractGeometryV2.

Definition at line 147 of file qgslinestringv2.cpp.

virtual QString QgsLineStringV2::geometryType ( ) const
inlineoverridevirtual

Returns a unique string representing the geometry type.

See also
wkbType
wktTypeStr

Implements QgsAbstractGeometryV2.

Definition at line 141 of file qgslinestringv2.h.

bool QgsLineStringV2::insertVertex ( QgsVertexId  position,
const QgsPointV2 vertex 
)
overridevirtual

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

Implements QgsAbstractGeometryV2.

Definition at line 644 of file qgslinestringv2.cpp.

double QgsLineStringV2::length ( ) const
overridevirtual

Returns the length of the geometry.

See also
area()
perimeter()

Reimplemented from QgsAbstractGeometryV2.

Definition at line 236 of file qgslinestringv2.cpp.

double QgsLineStringV2::mAt ( int  index) const

Returns the m value of the specified node in the line string.

Parameters
indexindex of node, where the first node in the line is 0
Returns
m value of node, or 0.0 if index is out of bounds or the line does not have m values
See also
setMAt()

Definition at line 359 of file qgslinestringv2.cpp.

bool QgsLineStringV2::moveVertex ( QgsVertexId  position,
const QgsPointV2 newPos 
)
overridevirtual

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

Implements QgsAbstractGeometryV2.

Definition at line 670 of file qgslinestringv2.cpp.

virtual int QgsLineStringV2::nCoordinates ( ) const
inlineoverridevirtual

Returns the number of nodes contained in the geometry.

Reimplemented from QgsAbstractGeometryV2.

Definition at line 167 of file qgslinestringv2.h.

int QgsLineStringV2::numPoints ( ) const
overridevirtual

Returns the number of points in the curve.

Implements QgsCurveV2.

Definition at line 281 of file qgslinestringv2.cpp.

bool QgsLineStringV2::operator!= ( const QgsCurveV2 other) const
overridevirtual

Implements QgsCurveV2.

Definition at line 74 of file qgslinestringv2.cpp.

bool QgsLineStringV2::operator== ( const QgsCurveV2 other) const
overridevirtual

Implements QgsCurveV2.

Definition at line 46 of file qgslinestringv2.cpp.

bool QgsLineStringV2::pointAt ( int  node,
QgsPointV2 point,
QgsVertexId::VertexType type 
) const
overridevirtual

Returns the point and vertex id of a point within the curve.

Parameters
nodenode number, where the first node is 0
pointwill be set to point at corresponding node in the curve
typewill be set to the vertex type of the node
Returns
true if node exists within the curve

Implements QgsCurveV2.

Definition at line 785 of file qgslinestringv2.cpp.

QgsPointV2 QgsLineStringV2::pointN ( int  i) const

Returns the specified point from inside the line string.

Parameters
iindex of point, starting at 0 for the first point

Definition at line 286 of file qgslinestringv2.cpp.

void QgsLineStringV2::points ( QgsPointSequenceV2 pt) const
overridevirtual

Returns a list of points within the curve.

Implements QgsCurveV2.

Definition at line 399 of file qgslinestringv2.cpp.

QgsLineStringV2 * QgsLineStringV2::reversed ( ) const
overridevirtual

Returns a reversed copy of the curve, where the direction of the curve has been flipped.

Note
added in QGIS 2.14

Implements QgsCurveV2.

Definition at line 528 of file qgslinestringv2.cpp.

void QgsLineStringV2::setMAt ( int  index,
double  m 
)

Sets the m value of the specified node in the line string.

Parameters
indexindex of node, where the first node in the line is 0. Corresponding node must already exist in line string, and the line string must have m values.
mm value of node
See also
mAt()

Definition at line 387 of file qgslinestringv2.cpp.

void QgsLineStringV2::setPoints ( const QgsPointSequenceV2 points)

Resets the line string to match the specified list of points.

The line string will inherit the dimensionality of the first point in the list.

Parameters
pointsnew points for line string. If empty, line string will be cleared.

Definition at line 409 of file qgslinestringv2.cpp.

void QgsLineStringV2::setXAt ( int  index,
double  x 
)

Sets the x-coordinate of the specified node in the line string.

Parameters
indexindex of node, where the first node in the line is 0. Corresponding node must already exist in line string.
xx-coordinate of node
See also
xAt()

Definition at line 367 of file qgslinestringv2.cpp.

void QgsLineStringV2::setYAt ( int  index,
double  y 
)

Sets the y-coordinate of the specified node in the line string.

Parameters
indexindex of node, where the first node in the line is 0. Corresponding node must already exist in line string.
yy-coordinate of node
See also
yAt()

Definition at line 374 of file qgslinestringv2.cpp.

void QgsLineStringV2::setZAt ( int  index,
double  z 
)

Sets the z-coordinate of the specified node in the line string.

Parameters
indexindex of node, where the first node in the line is 0. Corresponding node must already exist in line string, and the line string must have z-dimension.
zz-coordinate of node
See also
zAt()

Definition at line 381 of file qgslinestringv2.cpp.

QgsPointV2 QgsLineStringV2::startPoint ( ) const
overridevirtual

Returns the starting point of the curve.

See also
endPoint

Implements QgsCurveV2.

Definition at line 250 of file qgslinestringv2.cpp.

void QgsLineStringV2::sumUpArea ( double &  sum) const
overridevirtual

Calculates the area of the curve.

Derived classes should override this to return the correct area of the curve.

Implements QgsCurveV2.

Definition at line 840 of file qgslinestringv2.cpp.

QgsAbstractGeometryV2 * QgsLineStringV2::toCurveType ( ) const
overridevirtual

Returns the geometry converted to the more generic curve type QgsCompoundCurveV2.

Returns
the converted geometry. Caller takes ownership

Reimplemented from QgsAbstractGeometryV2.

Definition at line 589 of file qgslinestringv2.cpp.

void QgsLineStringV2::transform ( const QgsCoordinateTransform ct,
QgsCoordinateTransform::TransformDirection  d = QgsCoordinateTransform::ForwardTransform,
bool  transformZ = false 
)
overridevirtual

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.

Implements QgsAbstractGeometryV2.

Definition at line 602 of file qgslinestringv2.cpp.

void QgsLineStringV2::transform ( const QTransform t)
overridevirtual

Transforms the geometry using a QTransform object.

Parameters
tQTransform transformation

Implements QgsAbstractGeometryV2.

Definition at line 625 of file qgslinestringv2.cpp.

double QgsLineStringV2::vertexAngle ( QgsVertexId  vertex) const
overridevirtual

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

Implements QgsAbstractGeometryV2.

Definition at line 893 of file qgslinestringv2.cpp.

int QgsLineStringV2::wkbSize ( ) const
overridevirtual

Returns the size of the WKB representation of the geometry.

See also
asWkb

Implements QgsAbstractGeometryV2.

Definition at line 161 of file qgslinestringv2.cpp.

double QgsLineStringV2::xAt ( int  index) const

Returns the x-coordinate of the specified node in the line string.

Parameters
indexindex of node, where the first node in the line is 0
Returns
x-coordinate of node, or 0.0 if index is out of bounds
See also
setXAt()

Definition at line 335 of file qgslinestringv2.cpp.

double QgsLineStringV2::yAt ( int  index) const

Returns the y-coordinate of the specified node in the line string.

Parameters
indexindex of node, where the first node in the line is 0
Returns
y-coordinate of node, or 0.0 if index is out of bounds
See also
setYAt()

Definition at line 343 of file qgslinestringv2.cpp.

double QgsLineStringV2::zAt ( int  index) const

Returns the z-coordinate of the specified node in the line string.

Parameters
indexindex of node, where the first node in the line is 0
Returns
z-coordinate of node, or 0.0 if index is out of bounds or the line does not have a z dimension
See also
setZAt()

Definition at line 351 of file qgslinestringv2.cpp.

Friends And Related Function Documentation

friend class QgsPolygonV2
friend

Definition at line 219 of file qgslinestringv2.h.


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