I have two elements - geo_df - a set of Points identifying different assets and a raster (grid) where each grid/pixel has an associated value.
How do I overlay the points from the dataset upon the grid to get either the column/row index or the lat/long index of the vertices of the pixel?
This is what I have:
import rasterio
import geopandas
data_set = [['Site 1', 14.207355,40.840481], ['Site 2', 14.0743, 41.1552]]
df = pd.DataFrame(data_set, columns = ["Name", 'Latitude', 'Longitude'])
crs = {'init': 'epsg:4326'}
geo_df = GeoDataFrame(df, crs=crs, geometry=geometry)
geo_df
file = r'~raster.tif'
with rasterio.open(file, 'r+') as rds:
rds.crs = CRS.from_epsg(4326)
fig, ax = plt.subplots(figsize=(15, 15))
plt.imshow(rds.read(1), cmap='Reds')