smooth
Utilities for smoothing geometries.
Fork + Port of https://github.com/philipschall/shapelysmooth (Public domain)
InputeTypeError
Bases: TypeError
Raised when the input geometry is of the incorrect type.
Source code in src/rastr/gis/smooth.py
20 21 | |
catmull_rom_smooth(geometry, alpha=0.5, subdivs=10)
Polyline smoothing using Catmull-Rom splines.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
geometry
|
BaseGeometry
|
The geometry to smooth |
required |
alpha
|
float
|
The tension parameter, between 0 and 1 inclusive. Defaults to 0.5. - For uniform Catmull-Rom splines, alpha = 0. - For centripetal Catmull-Rom splines, alpha = 0.5. - For chordal Catmull-Rom splines, alpha = 1.0. |
0.5
|
subdivs
|
int
|
Number of subdivisions of each polyline segment. Default value: 10. |
10
|
Returns: The smoothed geometry.
Source code in src/rastr/gis/smooth.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | |