# libpysal.cg.get_shared_segments

libpysal.cg.get_shared_segments(poly1, poly2, bool_ret=False)

  Returns the line segments in common to both polygons.

  Parameters:
    poly1 `libpysal.cg.Polygon`

      A Polygon.

    poly2 `libpysal.cg.Polygon`

      A Polygon.

    bool_ret bool

      Return only a `bool`. Default is `False`.

  Returns:
    common `python:list`

      The shared line segments between `poly1` and `poly2`.

    _ret_bool bool

      Whether `poly1` and `poly2` share a segment (`True`) or not (`False`).

  Examples

      >>> from libpysal.cg.shapes import Polygon
      >>> x = [0, 0, 1, 1]
      >>> y = [0, 1, 1, 0]
      >>> poly1 = Polygon(list(map(Point, zip(x, y))) )
      >>> x = [a+1 for a in x]
      >>> poly2 = Polygon(list(map(Point, zip(x, y))) )
      >>> get_shared_segments(poly1, poly2, bool_ret=True)
      True