revrt.simplify_using_slopes#
- simplify_using_slopes(path, slope_tolerance=0.5)#
Simplify path geometry by removing points on the same slope.
This function removes all points that fall on the same slope, only keeping the points required to define new segments (i.e. changes in slope). This effectively reduces the storage requirement for a shapely LineString without changing the geometry at all.
- Parameters:
path (
listoftuple) – List of two-tuples containing floating-point numbers or integers representing the points making up the route. This function works best if these values represent array indices instead of values in a CRS.slope_tolerance (
float, default0.5) – Tolerance value for determining if two slopes are the same. For typical 8-direction routing, any value 1 and below should suffice. By default,0.5.
- Returns: