A class to trim lines and polygons to within a rectangular region. The functions in this class are likely to be called from within a render loop and hence need to as CPU efficient as possible. The main purpose of the functions in this class are to trim lines and polygons to lie within a rectangular region. This is necessary for drawing items to an X11 display which have a limit on the magnitude of the screen coordinates (+/- 32768, i.e. 16 bit integer).
clippedLine(curve: QgsCurve, clipExtent: QgsRectangle) → QPolygonF¶
Takes a linestring and clips it to clipExtent
- Return type
clipped line coordinates
clippedLine(curve: QPolygonF, clipExtent:
QgsRectangle) -> QPolygonF Takes a
curveand clips it to clipExtent.
New in version 3.16.
trimFeature(x: Iterable[float], y: Iterable[float], shapeOpen: bool)¶
Trims the given feature to a rectangular box. Returns the trimmed feature in x and y. The shapeOpen parameter determines whether the function treats the points as a closed shape (polygon), or as an open shape (linestring).
not available in Python bindings on android
x (Iterable[float]) –
y (Iterable[float]) –
shapeOpen (bool) –