Class: QgsCircularString

Circular string geometry type.

Class Hierarchy

Inheritance diagram of qgis.core.QgsCircularString

Base classes

QgsCurve

Abstract base class for curved geometry type.

QgsAbstractGeometry

Abstract base class for all geometries.

Methods

append

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

pointN

Returns the point at index i within the circular string.

setPoints

Sets the circular string's points

Static Methods

fromTwoPointsAndCenter

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

class qgis.core.QgsCircularString[source]

Bases: QgsCurve

__init__()

Constructs an empty circular string.

__init__(p1: QgsPoint, p2: QgsPoint, p3: QgsPoint)

Constructs a circular string with a single arc passing through p1, p2 and p3.

Added in version 3.2.

Parameters:
__init__(x: Iterable[float], y: Iterable[float], z: Iterable[float] = [], m: Iterable[float] = [])

Construct a circular string from arrays of coordinates. If the z or m arrays are non-empty then the resultant circular string will have z and m types accordingly.

This constructor is more efficient then calling setPoints().

If the sizes of x and y are non-equal then the resultant circular string will be created using the minimum size of these arrays.

Warning

It is the caller’s responsibility to ensure that the supplied arrays are of odd sizes.

Added in version 3.20.

Parameters:
  • x (Iterable[float])

  • y (Iterable[float])

  • z (Iterable[float] = [])

  • m (Iterable[float] = [])

__init__(a0: QgsCircularString)
Parameters:

a0 (QgsCircularString)

append(self, string: QgsCircularString | None)[source]

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

Parameters:

string (Optional[QgsCircularString]) – circular string to append. Ownership is not transferred.

Warning

It is the caller’s responsibility to ensure that the first point in the appended string matches the last point in the existing curve, or the result will be undefined.

Added in version 3.20.

static fromTwoPointsAndCenter(p1: QgsPoint, p2: QgsPoint, center: QgsPoint, useShortestArc: bool = True) QgsCircularString[source]

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).

Added in version 3.2.

Parameters:
Return type:

QgsCircularString

pointN(self, i: int) QgsPoint[source]

Returns the point at index i within the circular string.

Parameters:

i (int)

Return type:

QgsPoint

setPoints(self, points: Iterable[QgsPoint])[source]

Sets the circular string’s points

Parameters:

points (Iterable[QgsPoint])