The shape of a shapely polygon can easily be converted to an array of points by using
x,y = polygon.exterior.xy
However, this returns only the actual points.
How can I convert a shapely polygon to an array, with a 0 for each pixel outside of the shape, and a 1 for each pixel inside the shape?
Thus, for an example, a polygon with width=100, height=100 should result in a (100,100) array.
I could do this by getting the exterior points, and then looping through each pixel and seeing if it's inside/on the shape, or outside. But I think there should be an easier method?