How to extract reflectance values from a SAR-Optical stack in R

63 Views Asked by At

I have stacked sentinel-1 and sentinel-2 images in QGIS. I did preprocessing in SNAP and used the "align rasters" tool in QGIS to resample the images to 20m and to register them to a common projection. I want to perform classification in R, but it's taking forever to extract reflectance/backscatter values.

After reading my shapefile and my raster into R, I am stuck at the reflectance values extraction step.

training <- readOGR('C:/march2018/TrainingData.shp')

s12 <- brick('C:/march2018/s1s213bstack.tif')

names(s12) <- paste0("B", c(1:13))

s12ref <- extract(s12, training, df=TRUE)

I expect the last line to extract reflectance values using the shapefile to produce a dataframe

0

There are 0 best solutions below