I have a raster with 500 meter resolution that was in sinusoidal
projection, so I first converted it to WGS84
using the raster
package in R using the following code:
library (raster)
library(maptools)
#Load the tif file
tif <- raster("~/Sinu.tif")
# Extract the SRS of the original tif
CRS <- "+proj=sinu +lan_0=0 +x_0=0 +y_0=0 +R=631007.181 +units=m +no_defs"
#Transform the projection to WGS84
llcrs <- "+proj=longlat +ellps=WGS84 +datum=WGS84"
#Create a data frame of the original sinusoidal tif
DF <- as.data.frame(Sinu, xy=TRUE)
data(DF)
#Create the Transform
rll <- projectRaster(Sinu,crs = llcrs)
#ras_sinu <- raster(nrow=391, ncol=695, ext=extent(-9031818, 4773511, -870816, 4954666), crs=incrs)
#rs <- rasterImage(w, ras_sinu)
plot(rll)
Sin2WGS84 <- writeRaster(rll,filename = "~/Sinu2WGS84.tif")
The conversion was done to align the pixels of this finer resolution raster with another raster which is in WGS84
and has a spatial resolution of 1/16 (approximate to 6 kilometers). The coarser resolution raster has a representative gridded polygon file. I then imported the transformed tif file to ArcGIS and converted it to a Polygon in ArcGIS. This was done to see whether 12x12 (12 rows by 12 columns of pixels) 500M meter pixels fall in a coarser pixel. But as you can see in the following image I am getting either 10x10 or 11x11 pixels. What can I do in R or ArcGIS to solve this alignment problem? If anyone wants to access the data, please click here.