I have a large number of MODIS snow rasters which I am cropping with the extent of a shapefile. Currently, I am using spTransform
so that my shapefile has the same CRS as the rasters.
This code works perfectly, it returns a new raster with the extent of the shapefile. My question is: is there any reason to avoid this sinusoidal projection? Mathematically, it should preserve area better than another projection. Are there any disadvantages?
Here is my code, for reference.
prj.aea="+proj=sinu +lon_0=0 +x_0=0 +y_0=0 +a=6371007.181 +b=6371007.181 +units=m +no_defs"
##Import shapefile with WGS84 projection
dsn=getwd() # assumes current dir is folder with shapefile(s) to import
ut.mgmt1=readOGR(dsn=dsn,layer=paste(GEO,sep=""))
GEO=spTransform(ut.mgmt1,CRS=CRS(prj.aea))
temp = list.files(pattern="*.tif",recursive=FALSE)
####THIS WRITES A NEW, SMALLER RASTER####
for(x in 1:length(temp)){
r1 = raster(temp[x])
test = mask(r1,GEO)
writeRaster(test,file=temp[x],overwrite=TRUE)
}
prj.aea
string? Do you have a choice to download rasters in another projection? Or are you asking if you should warp your rasters to another projection first? – Spacedman Feb 26 '18 at 9:25prj.aea
string). I cannot download them in any other projection. I am wondering if I should reproject them, since this is an uncommon projection, or if my data are fine. Specifically, if someone has had any problems with leaving MODIS snow data in this projection I would like them to let me know. – J.W. Powell Feb 26 '18 at 23:22