Get all lattice points lying inside a Shapely polygon
问题 I need to find all the lattice points inside and on a polygon. Input: from shapely.geometry import Polygon, mapping sh_polygon = Polygon(((0,0), (2,0), (2,2), (0,2))) Output: (0, 0), (1, 0), (2, 0), (0, 1), (1, 1), (2, 1), (0, 2), (1, 2), (2, 2) Please suggest if there is a way to get the expected result with or without using Shapely. I have written this piece of code that gives points inside the polygon, but it doesn't give points on it. Also is there a better way to do the same thing: from