Search code examples
rrasterreprojection-error

Reprojection in R using MRT tool


I am trying to donwload and reproject MODIS data into GEO (Geographic) projection using the code below. However, there is an issue with the result. The output file dimensions is 1 by 1 pixel only (dimensions : 1, 1, 1 (nrow, ncol, ncell) instead of 4000 by 2200.

x <- "MOD09A1"
ModisDownload(x=x,h=c(9),v=c(6),
          dates=c("2011.01.01","2011.01.01"),
          MRTpath="~\\MRT_download_Win\\bin",
          proj=TRUE,
          proj_type="GEO",
          datum="WGS84",
          resample_type="NEAREST_NEIGHBOR",
          proj_params="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0",
          pixel_size=500)

Solution

  • The source of the error comes from the pixel size. Since the MODIS pixel size is 500 m, I wrongly wrote "pixel_size=500" in the R script. This was giving one single pixel of 500 degrees by 500 degrees as output. When projection type is Geographic (proj_type="GEO") the pixel size should be given in degrees. For the latitude of the MODIS tile in this example (tile h09v06) 0.004514 degrees are approximately 500 m. Therefore, the pixel size should be written in the script as: pixel_size=0.004514.