I have a list of boundary coordinates for a polygon. I want to extract some interior points from this polygon based on some sort of grid spacing that I can choose.
For example, say I have this:
from shapely.geometry import MultiPoint
Polygon([(0,0),
(1,0),
(1,1),
(0,1)])
This yields a simple square. However, we can imagine this square is actually a grid filled with an infinite number of points. For this example, let's say I want a list of points inside the square at 0.1 grid spacing. Is there a way to extract a list of these points?
For bonus points, how would we not only get the interior points, but also all of the boundary points at 0.1 grid spacing?
Edit: This question was mainly posed for non-rectangular shapes and has the purpose of finding points for shapes of counties/provinces/districts, etc. I just used a rectangle as a simple example. However, I accepted the proposed solution. Will give out upvotes to anyone who provides a more complex solution for non-rectangular objects