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 <[email protected]>
> To: "[email protected]" <[email protected]>
> Subject: [R-sig-Geo] Help with getting and processing MODIS data
> Message-ID:
>         <[email protected]>
> 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
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to