cartagen.min_break

Contents

cartagen.min_break#

min_break(line, offset, sigma=15.0, sample=None)#

Spread a road bend and minimize its extent.

This algorithm was proposed by Mustière. [1] [2] It mimics the cartographic technique of overlapping the internal border of the bend.

It creates a polygon from the linestring by closing it at it extremities, then it calculates the TIN skeleton, dilates it apply a gaussian smoothing.

Parameters:
  • line (LineString) – The line to dilate.

  • offset (float) – The distance to dilate the skeleton.

  • sigma (float, optional) – Gaussian smoothing strength.

  • sample (int, optional) – Gaussian smoothing sample size.

Returns:

LineString

See also

coalescence_splitting

Splits a line into parts when coalescence is detected.

max_break

Spread a road bend and keep its shape.

smooth_gaussian

Smooth a line and attenuate its inflexion points.

References

Examples

>>> line = LineString([(0, 0), (3, 3), (6, 0)])
>>> min_break(line, 1.0)
<LINESTRING (5 0, 5 1, 5 2, 4.97 2.347, 4.879 2.684...)>

(Source code)

../_images/min_break.png