I have the following shapely pixel polygon
big_poly = Polygon([(94.5, 77.0),
(92.5, 53.0),
(87.5, 45.0),
(66.0, 20.5),
(9.0, 3.5),
(5.5, 6.0),
(4.5, 13.0),
(7.5, 26.0),
(6.5, 91.0),
(8.0, 92.5),
(16.0, 92.5),
(44.0, 86.5)])
I need to fill the big_poly
with 4 by 6, pixel polygons, have them all fall within the border of the big one and parallel to its min axis (same rotation).
The solutions here sure were helpful thanks to @Georgy. So I was able to do the following:
with the following code:
b = building_poly.boundary
points = []
for x in range(int(np.floor(xmin)), int(np.ceil(xmax)), 4):
for y in range(int(np.floor(ymin)), int(np.ceil(ymax)), 6):
points.append((x, y))
points = MultiPoint(points)
result = points.intersection(building_poly)
And plotting the points in result
, but now I need to create polygons from these points.
How can I turn these points into rectangular polygons?
I also found this, but not sure how to make it fit my case.