I have been trying to crop out certain area of interest from a raster type .tif image format. I was successfully able to implement that in R, but since shiny doesn't provide much for free, i have to switch from R to python to make a web app. I searched a lot for this problem but couldn't find much. This is the code in R whose functionality in desired:
library(raster)
library(sp)
br<-raster("br.tif")
plot(br)
ps<-as(extent(90.35, 90.5, 25.45,25.55),"SpatialPolygons")
proj4string(ps)<-"+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"
aoi_br=crop(br,ps)
plot(aoi_br)
I tried shapely in python, but had trouble installing it, which i then searched and found that it was a problem with many people. I also tried using "pyper" package to call my R script, but that too had troubles.
How can this be implemented?