How get raster row and col position of a shape point?

Viewed 35

I have a raster of NDVI value from MODIS. I have also a point shapefile that indicates a cell of interest. I would know the position of this point as raster row and column coordinates. How can I do it in R?

library(raster)
library(sf)
setwd("C:/timesat33/data/wa/finali")
r <- raster("__MOD13Q1.006__250m_16_days_NDVI_doy2001305_aid0001.tif")
plot(r)
p <- st_read("I:/Papers/Mine/2021_Mozambique/MODIS_NDVI/proveR/shape01.shp")
plot(p, add=TRUE, col="purple")

plot

0 Answers
Related