[R-sig-Geo] Help with getting and processing MODIS data
Jonathan Greenberg
jgrn at illinois.edu
Sun Jan 12 21:03:36 CET 2014
Hi Julie:
You might want to check our new package gdalUtils (the r-forge version
is the current best):
install.packages("gdalUtils", repos="http://R-Forge.R-project.org")
You'll need to install GDAL first if you don't have it
(http://trac.osgeo.org/gdal/wiki/DownloadingGdalBinaries)
Take a look at the examples from ?get_subdatasets and ?gdal_translate
(I even have a sample MODIS tile, I think an EVI/NDVI, in the
package).
--j
On Fri, Jan 10, 2014 at 10:04 AM, Jill Deines <jillian.deines at gmail.com> wrote:
> Hi Julie,
>
> I haven't used the modisDownload package you mention, but I have had great
> success with another MODIS package in development, MODIS, which can be
> found here:
>
> https://r-forge.r-project.org/R/?group_id=1252
>
> It can use the MRT or use gdal binaries directly. It's slightly
> complicated to set up the dependencies, but once it is, it makes batch
> downloading, mosaicing, and reprojecting incredibly easy.
>
> Steven Mosher wrote a nice tutorial for this package that helped me a lot
> with the set-up that can be found here:
> http://stevemosher.wordpress.com/modis-tutorial/
>
> It's slightly outdated - you no longer need to be able to build the package
> yourself (just download from the link above), and it was written when MODIS
> still used a ftp server instead of the updated http server, so I'd
> recommend starting on this page (and reading the comments for a few
> updates):
> http://stevemosher.wordpress.com/modis-reprojection-tool/, and probably
> skipping the last two pages.
>
> It's written for Windows installs, but I assume it can be adapted for a
> Mac. You can use either MRT or gdal, so only one of these needs to be
> installed. I find the gdal version easier to set the projection output,
> but the MRT is a bit faster.
>
> Once installed:
>
> library(MODIS)
>
> # set storage paths
>
> # for storing downloaded data
> MODISoptions(localArcPath = 'setFilepathForRawTiles')
>
> # for storing output
> MODISoptions(outDirPath = 'setFilepathForOutput')
>
> # check setup
> MODISoptions()
>
> __________
> Then use either function 'runGdal' or 'runMrt' to process with either tool.
> The package has pretty good help files.
>
> Jill
>
>
>
>
>
>> Message: 8
>> Date: Thu, 9 Jan 2014 11:59:14 -0800 (PST)
>> From: Julie Lee-Yaw <julleeyaw at yahoo.ca>
>> To: "r-sig-geo at r-project.org" <r-sig-geo at r-project.org>
>> Subject: [R-sig-Geo] Help with getting and processing MODIS data
>> Message-ID:
>> <1389297554.95170.YahooMailNeo at web142502.mail.bf1.yahoo.com>
>> Content-Type: text/plain
>>
>> Hi all
>>
>> I am fairly new to GIS and R and am trying to download, reproject, mosaic
>> and save MODIS NDVI and EVI data as a geotiff. I need tiles from across
>> North America, so a lot of data and would prefer to find an automatic
>> solution. I've come across modisDownload but can't seem to get it to work…I
>> think the code below manages to download the hdf files but I don't see the
>> geotiff mosaic file that I expect (code based on tutorial found at
>> http://r-gis.net/?q=ModisDownload):
>>
>> I am using a mac and the MRT bin folder is stored in my "Applications"
>> folder.
>> ######### setwd("./MODIS") # set directory to location R script and where
>> I want the output
>> mrtpath<-"/Applications/bin" # tell R where MRT is stored
>> source('ModisDownload.R') # run the R script from r-gis.net
>> library(RCurl) #raster package is already loaded
>> x=3 # Now as per the online tutorial which gives code to do the following
>> # Downloads selected tiles, and mosaic, reproject them in UTM_WGS84, zone
>> 30 projection and convert all bands into Geotif format (the original HDF
>> will be deleted!)
>> ModisDownload(x=x,h=c(17,18),v=c(4,5),dates="2011.05.01",MRTpath=mrtpath,proj_type="UTM",utm_zone=30,datum="WGS84",pixel_size=1000)
>> #########
>>
>> Can anyone tell me what I'm doing wrong? The code seems to run but only
>> produces four hdf files… I'm open to other suggestions as to how to get and
>> process MODIS data…even the MRT tool seems to be giving me trouble so if
>> there is a step-by-step tutorial for beginners out there for how to do
>> this, I'd really appreciate a point in the right direction!
>>
>> Thanks
>> [[alternative HTML version deleted]]
>>
>>
>
> [[alternative HTML version deleted]]
>
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
--
Jonathan A. Greenberg, PhD
Assistant Professor
Global Environmental Analysis and Remote Sensing (GEARS) Laboratory
Department of Geography and Geographic Information Science
University of Illinois at Urbana-Champaign
259 Computing Applications Building, MC-150
605 East Springfield Avenue
Champaign, IL 61820-6371
Phone: 217-300-1924
http://www.geog.illinois.edu/~jgrn/
AIM: jgrn307, MSN: jgrn307 at hotmail.com, Gchat: jgrn307, Skype: jgrn3007
More information about the R-sig-Geo
mailing list