I'm trying to sample raster values to points based on the geometries of a shapefile using the below code but the raster values are only sampled at the coordinates of the polygon geometry. Is there a way to sample for all the points along the boundary and inside the polygon.
multi_values_points = pd.Series()
with fiona.open(inputShape) as shp:
for feature in shp:
Name = feature['properties']['Name']
coords = feature['geometry']['coordinates']
with rio.open(inputRaster) as stack_src:
value = [v for v in stack_src.sample([coords])]
multi_values_points.loc[Name] = value