title: Python - shapely: Iterating with method "difference" return unexpected result
body: <p>I'm actually working with shapely on python.</p>
  
  <p>Here is the things:</p>
  
  <p>I have one big polygon, let say</p>
  
  <pre><code>import matplotlib.pyplot as plt
  import shapely
  from shapely.geometry import Polygon
  LAND = Polygon([(0, 0), (0, 20), (20, 20), (20, 0)])
  </code></pre>
  
  <p>and I have a list of random polygon generate with</p>
  
  <pre><code>import random
  def generate_polygons(box_size=10, amount=15):
      """
      A function that generate an amount of polygon randomly
      in a square of size = box_size
      """
      polygons = []
      for i in range(amount):
          x = random.randint(0, box_size - 2)
          y = random.randint(0, box_size - 2)
          dx = 2
          dy = 2
          polygons.append(Polygon([(x, y), (x, y+dy), (x+dx, y+dy), (x+dx, y)]))
      return polygons
  </code></pre>
  
  <p>I want to make the difference between the LAND and the list of polygons</p>
  
  <pre><code>diff = LAND
  polygons = generate_polygons(20, 15)
  
  for polygon in polygons:
      diff = diff.difference(polygon)
  </code></pre>
  
  <p>Let's plot the result
  Here are the polygons:</p>
  
  <pre><code>FIG, AXS = plt.subplots()
  
  if (isinstance(polygons, shapely.geometry.polygon.Polygon)):
      X, Y = polygons.exterior.xy
      AXS.fill(X, Y, 'b')
  else:
      for polygon in polygons:
          X, Y = polygon.exterior.xy
          AXS.fill(X, Y, 'b')
  
  plt.show()
  </code></pre>
  
  <p>Here is the diff:</p>
  
  <pre><code>FIG, AXS = plt.subplots()
  
  if (isinstance(diff, shapely.geometry.polygon.Polygon)):
      X, Y = diff.exterior.xy
      AXS.fill(X, Y, 'r', alpha=0.5)
  else:
      for polygon in diff:
          X, Y = polygon.exterior.xy
          AXS.fill(X, Y, 'r', alpha=0.5)
  
  plt.show()
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/6t8NP.png" rel="nofollow noreferrer">polygon in blue, diff in red</a></p>
  
  <p>I don't understand why It give me this result, anybody have an idea ?</p>