[R-sig-Geo] Easiest way to get a a subset from MODIS

Andy Bunn Andy.Bunn at wwu.edu
Thu May 25 06:34:44 CEST 2017


Answering my own question.

I was able to do what I wanted using the MODIS package. The runGdal function does what I want. Thanks to those who coded it!

-A

From: Andy Bunn <andy.bunn at wwu.edu<mailto:andy.bunn at wwu.edu>>
Date: Wednesday, May 24, 2017 at 12:22 PM
To: R-sig-Geo <r-sig-geo at r-project.org<mailto:r-sig-geo at r-project.org>>
Subject: Easiest way to get a a subset from MODIS

Hi all, It's been years since I've used any MODIS data. Looking around I see there are many R packages that purport to interface nicely with MODIS servers and deliver you a subset of data.

I have an EarthData login and can (and have) download the tile I want via http://search.earthdata.nasa.gov but getting the hdf, converting to tif, clipping etc. is tedious and I'm wondering what the best way to do this in R is. So,  let's imagine I would like to get a class(raster) object of the "250m_16_days_NDVI" band from "MYD13Q1" product for a 10x10km area around the point c(68.75,161.42) for the period of nearest July 1, 2015. What package and approach is the easiest in R?

Is it something like this?

library(MODISTools)
dat2get <- data.frame(lat=68.75,long=161.42,
                      start.date=as.POSIXlt("2015-07-01"),
                      end.date=as.POSIXlt("2015-07-01"),
                      ID=1)

MODISSubsets(LoadDat = dat2get,
             Products = "MYD13Q1",
             Bands = "250m_16_days_NDVI",
             Size = c(10,10),
             StartDate = TRUE)

Regards, Andy



	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list