How do I create a point_grid.shp over the extent of a polygon_extent.shp?
Spacing between the points must be in meters.
This is a pseudo-code adaptation of code found to create a polygon grid (I just want the points though):
dir = Path("").absolute() # working directory
bounds = gpd.read_file(dir / 'boundaries.shp')
def shp_to_point_grid(bounds, spacing_x, spacing_y):
polygons = list()
# code
return pointgrid_shp
shape_file_here = shp_to_point_grid(bounds, 2000, 2000)
grid = gpd.GeoDataFrame(shape_file_here) # not sure how to format this
grid.to_file(dir / "pointgrid.shp")