title: Creating polygons using rasterio and shapely based on a lon, lat and an array of 0's and 1's
body: <p>I have an numpy array with 0 and 1's. I am trying to convert the 1's into polygons. I have managed to do so using rasterio and shapely as seen in the code below:</p>
  <pre><code>im = np.array([[0, 0, 0, 0, 0],
     [0, 1, 1, 1, 0],
     [0, 0, 1, 0, 0],
     [0, 1, 1, 1, 0],
     [0, 0, 0, 0, 0]])
  shapes = rasterio.features.shapes(im)
  polygons = [shapely.geometry.Polygon(shape[0][&quot;coordinates&quot;][0]) for shape in shapes if shape[1] == 1]
  print(polygon[0])
  </code></pre>
  <p>however, each row and column reffers to longitude and latitude coordinates stored in different arrays. for example:</p>
  <pre><code>lon = np.array([125.  , 125.25, 125.5 , 125.75, 126.  ])
  lat = np.array([-35.  , -35.25, -35.5 , -35.75, -36.  ])
  </code></pre>
  <p>Does anyone know how to create the polygons associated with the correct coordinates? I think I have to use the transform parameter of the rasterio.features.shapes function. Yet I haven't been able to figure it out yet.</p>