Class: QgsSimpleCurve¶
Abstract base class for simple curved geometry type.
This class is not part of the SQL/MM standard and only exists for implementation convenience.
Added in version 4.2.
Note
This is an abstract class, with methods which must be implemented by a subclass.
The following methods must be implemented: QgsCurve.addToPainterPath(), QgsAbstractGeometry.asGml2(), QgsAbstractGeometry.asGml3(), QgsAbstractGeometry.closestSegment(), QgsAbstractGeometry.createEmptyWithSameType(), QgsCurve.curveSubstring(), QgsCurve.curveToLine(), QgsAbstractGeometry.deleteVertex(), QgsAbstractGeometry.deleteVertices(), QgsCurve.distanceBetweenVertices(), QgsAbstractGeometry.draw(), QgsCurve.drawAsPolygon(), QgsAbstractGeometry.geometryType(), QgsCurve.indexOf(), QgsAbstractGeometry.insertVertex(), QgsCurve.interpolatePoint(), QgsCurve.pointAt(), QgsAbstractGeometry.removeDuplicateNodes(), QgsAbstractGeometry.segmentLength(), QgsAbstractGeometry.simplifyByDistance(), QgsAbstractGeometry.snappedToGrid(), QgsCurve.sumUpArea(), QgsCurve.sumUpArea3D(), QgsAbstractGeometry.vertexAngle()
List of all members, including inherited members
Class Hierarchy¶
Base classes¶
Abstract base class for curved geometry type. |
|
Abstract base class for all geometries. |
Subclasses¶
Circular string geometry type. |
|
Line string geometry type, with support for z-dimension and m-values. |
Abstract Methods
Returns the m value of the specified node in the simple curve. |
|
Returns the x-coordinate of the specified node in the simple curve. |
|
Returns the y-coordinate of the specified node in the simple curve. |
|
Returns the z-coordinate of the specified node in the simple curve. |
Methods
Appends the contents of another simple curve to the end of this simple curve. |
|
Returns the point at the specified index. |
|
Sets the m-coordinate of the specified node in the simple curve. |
|
Resets the simple curve to match the specified list of points. |
|
Sets the x-coordinate of the specified node in the simple curve. |
|
Sets the y-coordinate of the specified node in the simple curve. |
|
Sets the z-coordinate of the specified node in the simple curve. |
- class qgis.core.QgsSimpleCurve[source]¶
Bases:
QgsCurve- append(self, curve: QgsSimpleCurve | None)[source]¶
Appends the contents of another simple curve to the end of this simple curve.
- Parameters:
curve (Optional[QgsSimpleCurve]) – curve to append. Ownership is not transferred.
Note
The curve type to be appended must match the base curve type. That is, Only LinearStrings can be appended to LinearStrings and only CircularStrings can be appended to CircularStrings.
Warning
It is the caller’s responsibility to ensure that the first point in the appended
curvematches the last point in the existing curve, or the result will be undefined.- Raises:
ValueError – if a LineString is passed to be appended to a CircularString or viceversa.
- abstract mAt(self, index: int) float[source]¶
Returns the m value of the specified node in the simple curve.
If the SimpleCurve does not have m values then
NaNwill be returned. Indexes can be less than 0, in which case they correspond to positions from the end of the curve. E.g. an index of -1 corresponds to the last point in the curve.- Raises:
IndexError – if no point with the specified index exists.
- Parameters:
index (int)
- Return type:
float
- pointN(self, i: int) QgsPoint[source]¶
Returns the point at the specified index.
Indexes can be less than 0, in which case they correspond to positions from the end of the simple curve. E.g. an index of -1 corresponds to the last point in the simple curve.
- Raises:
IndexError – if no point with the specified index exists.
- Parameters:
i (int)
- Return type:
- setMAt(self, index: int, m: float)[source]¶
Sets the m-coordinate of the specified node in the simple curve. The corresponding node must already exist in the simple curve and the simple curve must have m-dimension.
Indexes can be less than 0, in which case they correspond to positions from the end of the curve. E.g. an index of -1 corresponds to the last point in the curve.
- Raises:
IndexError – if no point with the specified index exists.
See also
- Parameters:
index (int)
m (float)
- setPoints(self, points: Iterable[QgsPoint])[source]¶
Resets the simple curve to match the specified list of points. The simple curve will inherit the dimensionality of the first point in the list.
- Parameters:
points (Iterable[QgsPoint]) – new points for simple curve. If empty, simple curve will be cleared.
- setXAt(self, index: int, x: float)[source]¶
Sets the x-coordinate of the specified node in the simple curve. The corresponding node must already exist in simple curve.
Indexes can be less than 0, in which case they correspond to positions from the end of the curve. E.g. an index of -1 corresponds to the last point in the curve.
- Raises:
IndexError – if no point with the specified index exists.
See also
- Parameters:
index (int)
x (float)
- setYAt(self, index: int, y: float)[source]¶
Sets the y-coordinate of the specified node in the simple curve. The corresponding node must already exist in the simple curve.
Indexes can be less than 0, in which case they correspond to positions from the end of the curve. E.g. an index of -1 corresponds to the last point in the curve.
- Raises:
IndexError – if no point with the specified index exists.
See also
- Parameters:
index (int)
y (float)
- setZAt(self, index: int, z: float)[source]¶
Sets the z-coordinate of the specified node in the simple curve. The corresponding node must already exist in the simple curve and the simple curve must have z-dimension.
Indexes can be less than 0, in which case they correspond to positions from the end of the curve. E.g. an index of -1 corresponds to the last point in the curve.
- Raises:
IndexError – if no point with the specified index exists.
See also
- Parameters:
index (int)
z (float)
- abstract xAt(self, index: int) float[source]¶
Returns the x-coordinate of the specified node in the simple curve.
Indexes can be less than 0, in which case they correspond to positions from the end of the curve. E.g. an index of -1 corresponds to the last point in the curve.
- Raises:
IndexError – if no point with the specified index exists.
- Parameters:
index (int)
- Return type:
float
- abstract yAt(self, index: int) float[source]¶
Returns the y-coordinate of the specified node in the simple curve.
Indexes can be less than 0, in which case they correspond to positions from the end of the curve. E.g. an index of -1 corresponds to the last point in the curve.
- Raises:
IndexError – if no point with the specified index exists.
- Parameters:
index (int)
- Return type:
float
- abstract zAt(self, index: int) float[source]¶
Returns the z-coordinate of the specified node in the simple curve.
If the SimpleCurve does not have a z-dimension then
NaNwill be returned. Indexes can be less than 0, in which case they correspond to positions from the end of the curve. E.g. an index of -1 corresponds to the last point in the curve.- Raises:
IndexError – if no point with the specified index exists.
- Parameters:
index (int)
- Return type:
float