Dear Julie,

You should put some more arguments in the function including: mosaic=TRUE and proj=TRUE, otherwise, only HDF files are downloaded (the default is FALSE for these argument). Since in the older version of the function, the default were TRUE for these arguments, I forgot to put them in the tutorial after the new major updates . Sorry for the confusion. It is updated now!

So, your function should be like:

ModisDownload(x=x,h=c(17,18),v=c(4,5),dates="2011.05.01",MRTpath=mrtpath,mosaic=T,proj=T,proj_type="UTM",utm_zone=30,datum="WGS84",pixel_size=1000)

Good luck,

Babak




Date: Fri, 10 Jan 2014 11:04:26 -0500
From: Jill Deines <jillian.deines@gmail.com>
To: r-sig-geo@r-project.org
Subject: Re: [R-sig-Geo] Help with getting and processing MODIS data
Message-ID:
        <CAKCTE4zfgoS-1h0UkuHZO=hpHOi6gJr5RQd7JKNQByCiU4J9Ng@mail.gmail.com>
Content-Type: text/plain

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@yahoo.ca>
> To: "r-sig-geo@r-project.org" <r-sig-geo@r-project.org>
> Subject: [R-sig-Geo] Help with getting and processing MODIS data
> Message-ID:
>         <1389297554.95170.YahooMailNeo@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]]

