Test recovery from operation on invalid geometries
==================================================

  Make a self-intersecting polygon

  >>> from shapely.geometry import Polygon
  >>> polygon_invalid = Polygon(((0, 0), (1, 1), (1, -1), (0, 1), (0, 0)))
  >>> polygon_invalid.is_valid
  False

  Intersect with a valid polygon

  >>> polygon = Polygon(((-.5, -.5), (-.5, .5), (.5, .5), (.5, -5)))
  >>> polygon.is_valid
  True
  >>> polygon_invalid.intersects(polygon)
  True
  >>> result = polygon_invalid.intersection(polygon) # doctest: +ELLIPSIS
  Traceback (most recent call last):
  ...
  TopologicalError: The operation 'GEOSIntersection' produced a null geometry. Likely cause is invalidity of the geometry <shapely.geometry.polygon.Polygon object at ...>

  Check exception symmetry

  >>> result = polygon.intersection(polygon_invalid) # doctest: +ELLIPSIS
  Traceback (most recent call last):
  ...
  TopologicalError: The operation 'GEOSIntersection' produced a null geometry. Likely cause is invalidity of the 'other' geometry <shapely.geometry.polygon.Polygon object at ...>

