cartagen.coalescence_splitting

cartagen.coalescence_splitting#

coalescence_splitting(line, width, legibility_factor=1.7, join_style='round', quad_segs=16, debug=False)#

Splits a line into parts when coalescence is detected.

This algorithm proposed by Mustière [1] [2] subdivides the provided line into multiple parts with either no coalescence (‘none’), or coalescence on one side (‘left’ or ‘right’), or coalescence on both sides (‘both’).

Parameters:
  • line (LineString) – The line to detect the pastiness from.

  • width (float) – The width of the offset used to detect the coalescence.

  • legibility_factor (float, optional) – Detected coalescence chunks that are separated by a distance below legibility_factor * tolerance are grouped together.

  • join_style (str, optional) – The type of caps at the start and end of the provided line. Possible values are ‘round’ or ‘flat’.

  • quad_segs (int, optional) – The number of point allowed per circle quadrant when interpolating points using round method.

Returns:

Tuple[List[LineString], List[str]] – Tuple of two -> A line and its coalescence (‘none’, ‘left’, ‘right’, ‘both’)

References

(Source code)

../_images/coalescence_splitting.png