Class: QgsCircularString

class qgis.core.QgsCircularString

Bases: QgsCurve

Constructs an empty circular string.

QgsCircularString(p1: QgsPoint, p2: QgsPoint, p3: QgsPoint) Constructs a circular string with a single arc passing through p1, p2 and p3.

New in version 3.2.

QgsCircularString(QgsCircularString)

Circular string geometry type

New in version 2.10:

Methods

addMValue

param mValue

addToPainterPath

param path

addZValue

param zValue

asGml2

param doc

asGml3

param doc

asWkb

param flags

asWkt

param precision

calculateBoundingBox

rtype

QgsRectangle

childCount

childGeometry

Returns pointer to child geometry (for geometries with child geometries - i.e. geom.

childPoint

clear

clearCache

clone

rtype

QgsCircularString

closestSegment

param pt

createEmptyWithSameType

rtype

QgsCircularString

curveSubstring

param startDistance

curveToLine

param tolerance

deleteVertex

param position

dimension

rtype

int

draw

param p

drawAsPolygon

param p

dropMValue

rtype

bool

dropZValue

rtype

bool

endPoint

rtype

QgsPoint

equals

param other

fromTwoPointsAndCenter

Creates a circular string with a single arc representing the curve from p1 to p2 with the specified center.

fromWkb

param wkb

fromWkt

param wkt

geometryType

rtype

str

hasChildGeometries

Returns whether the geometry has any child geometries (False for point / curve, True otherwise)

hasCurvedSegments

rtype

bool

insertVertex

param position

interpolatePoint

param distance

isEmpty

rtype

bool

length

rtype

float

moveVertex

param position

numPoints

rtype

int

pointAt

param node

pointN

Returns the point at index i within the circular string.

points

rtype

List[QgsPoint]

removeDuplicateNodes

param epsilon

reversed

rtype

QgsCircularString

segmentLength

param startVertex

setPoints

Sets the circular string's points

setZMTypeFromSubGeometry

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

snappedToGrid

param hSpacing

startPoint

rtype

QgsPoint

sumUpArea

rtype

float

swapXy

transform

param ct

vertexAngle

param vertex

wkbSize

param flags

xAt

param index

yAt

param index

addMValue(self, mValue: float = 0) bool
Parameters

mValue (float = 0) –

Return type

bool

addToPainterPath(self, path: QPainterPath)
Parameters

path (QPainterPath) –

addZValue(self, zValue: float = 0) bool
Parameters

zValue (float = 0) –

Return type

bool

asGml2(self, doc: QDomDocument, precision: int = 17, ns: str = '', axisOrder: QgsAbstractGeometry.AxisOrder = QgsAbstractGeometry.AxisOrder.XY) QDomElement
Parameters
  • doc (QDomDocument) –

  • precision (int = 17) –

  • ns (str = '') –

  • axisOrder (QgsAbstractGeometry.AxisOrder = QgsAbstractGeometry.AxisOrder.XY) –

Return type

QDomElement

asGml3(self, doc: QDomDocument, precision: int = 17, ns: str = '', axisOrder: QgsAbstractGeometry.AxisOrder = QgsAbstractGeometry.AxisOrder.XY) QDomElement
Parameters
  • doc (QDomDocument) –

  • precision (int = 17) –

  • ns (str = '') –

  • axisOrder (QgsAbstractGeometry.AxisOrder = QgsAbstractGeometry.AxisOrder.XY) –

Return type

QDomElement

asWkb(self, flags: Union[QgsAbstractGeometry.WkbFlags, QgsAbstractGeometry.WkbFlag] = QgsAbstractGeometry.WkbFlags()) QByteArray
Parameters

flags (Union[QgsAbstractGeometry.WkbFlags) –

Return type

QByteArray

asWkt(self, precision: int = 17) str
Parameters

precision (int = 17) –

Return type

str

calculateBoundingBox(self) QgsRectangle
Return type

QgsRectangle

childCount(self) int
childGeometry(self, index: int) QgsAbstractGeometry

Returns pointer to child geometry (for geometries with child geometries - i.e. geom. collection / polygon)

Note

used for vertex_iterator implementation

New in version 3.0.

childPoint(self, index: int) QgsPoint
clear(self)
clearCache(self)
clone(self) QgsCircularString
Return type

QgsCircularString

closestSegment(self, pt: QgsPoint, epsilon: float = 4 * DBL_EPSILON) Tuple[float, QgsPoint, QgsVertexId, int]
Parameters
  • pt (QgsPoint) –

  • epsilon (float = 4*DBL_EPSILON) –

Return type

Tuple[float, QgsPoint, QgsVertexId, int]

createEmptyWithSameType(self) QgsCircularString
Return type

QgsCircularString

curveSubstring(self, startDistance: float, endDistance: float) QgsCircularString
Parameters
  • startDistance (float) –

  • endDistance (float) –

Return type

QgsCircularString

curveToLine(self, tolerance: float = M_PI_2 / 90, toleranceType: QgsAbstractGeometry.SegmentationToleranceType = QgsAbstractGeometry.MaximumAngle) QgsLineString
Parameters
  • tolerance (float = M_PI_2/90) –

  • toleranceType (QgsAbstractGeometry.SegmentationToleranceType = QgsAbstractGeometry.MaximumAngle) –

Return type

QgsLineString

deleteVertex(self, position: QgsVertexId) bool
Parameters

position (QgsVertexId) –

Return type

bool

dimension(self) int
Return type

int

draw(self, p: QPainter)
Parameters

p (QPainter) –

drawAsPolygon(self, p: QPainter)
Parameters

p (QPainter) –

dropMValue(self) bool
Return type

bool

dropZValue(self) bool
Return type

bool

endPoint(self) QgsPoint
Return type

QgsPoint

equals(self, other: QgsCurve) bool
Parameters

other (QgsCurve) –

Return type

bool

fromTwoPointsAndCenter(p1: QgsPoint, p2: QgsPoint, center: QgsPoint, useShortestArc: bool = True) QgsCircularString

Creates a circular string with a single arc representing the curve from p1 to p2 with the specified center.

If useShortestArc is True, then the arc returned will be that corresponding to the shorter arc from p1 to p2. If it is False, the longer arc from p1 to p2 will be used (i.e. winding the other way around the circle).

New in version 3.2.

Parameters
Return type

QgsCircularString

fromWkb(self, wkb: QgsConstWkbPtr) bool
Parameters

wkb (QgsConstWkbPtr) –

Return type

bool

fromWkt(self, wkt: str) bool
Parameters

wkt (str) –

Return type

bool

geometryType(self) str
Return type

str

hasChildGeometries(self) bool

Returns whether the geometry has any child geometries (False for point / curve, True otherwise)

Note

used for vertex_iterator implementation

New in version 3.0.

hasCurvedSegments(self) bool
Return type

bool

insertVertex(self, position: QgsVertexId, vertex: QgsPoint) bool
Parameters
Return type

bool

interpolatePoint(self, distance: float) QgsPoint
Parameters

distance (float) –

Return type

QgsPoint

isEmpty(self) bool
Return type

bool

length(self) float
Return type

float

moveVertex(self, position: QgsVertexId, newPos: QgsPoint) bool
Parameters
Return type

bool

numPoints(self) int
Return type

int

pointAt(self, node: int, point: QgsPoint) Tuple[bool, QgsVertexId.VertexType]
Parameters
Return type

Tuple[bool, QgsVertexId.VertexType]

pointN(self, i: int) QgsPoint

Returns the point at index i within the circular string.

Parameters

i (int) –

Return type

QgsPoint

points(self) List[QgsPoint]
Return type

List[QgsPoint]

removeDuplicateNodes(self, epsilon: float = 4 * DBL_EPSILON, useZValues: bool = False) bool
Parameters
  • epsilon (float = 4*DBL_EPSILON) –

  • useZValues (bool = False) –

Return type

bool

reversed(self) QgsCircularString
Return type

QgsCircularString

segmentLength(self, startVertex: QgsVertexId) float
Parameters

startVertex (QgsVertexId) –

Return type

float

setPoints(self, points: Iterable[QgsPoint])

Sets the circular string’s points

Parameters

points (Iterable[QgsPoint]) –

setZMTypeFromSubGeometry(self, subggeom: QgsAbstractGeometry, baseGeomType: QgsWkbTypes.Type)

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

snappedToGrid(self, hSpacing: float, vSpacing: float, dSpacing: float = 0, mSpacing: float = 0) QgsCircularString
Parameters
  • hSpacing (float) –

  • vSpacing (float) –

  • dSpacing (float = 0) –

  • mSpacing (float = 0) –

Return type

QgsCircularString

startPoint(self) QgsPoint
Return type

QgsPoint

sumUpArea(self) float
Return type

float

swapXy(self)
transform(self, ct: QgsCoordinateTransform, d: QgsCoordinateTransform.TransformDirection = QgsCoordinateTransform.ForwardTransform, transformZ: bool = False)
transform(self, t: QTransform, zTranslate: float = 0, zScale: float = 1, mTranslate: float = 0, mScale: float = 1) None
Parameters
  • ct (QgsCoordinateTransform) –

  • d (QgsCoordinateTransform.TransformDirection = QgsCoordinateTransform.ForwardTransform) –

  • transformZ (bool = False) –

vertexAngle(self, vertex: QgsVertexId) float
Parameters

vertex (QgsVertexId) –

Return type

float

wkbSize(self, flags: Union[QgsAbstractGeometry.WkbFlags, QgsAbstractGeometry.WkbFlag] = QgsAbstractGeometry.WkbFlags()) int
Parameters

flags (Union[QgsAbstractGeometry.WkbFlags) –

Return type

int

xAt(self, index: int) float
Parameters

index (int) –

Return type

float

yAt(self, index: int) float
Parameters

index (int) –

Return type

float