[R-sig-Geo] wget error While downloading a MODIS Tile

Matteo Mattiuzzi matteo.mattiuzzi at boku.ac.at
Mon Dec 10 16:44:37 CET 2012


There is currently being created a Blog: http://stevemosher.wordpress.com/
I think the very last changes are not specified there for now. So I suggest to first try the lines below and if you face problems the blog may helps. Soon the blog will become a nice description with examples!
  
The MODIS package is intended to download MODIS Grid (land) data from from LP_DAAC and LAADS Server (manly done by the ?getHdf function)
to pre-process the data (conversion from HDF to GeoTIFF, crop, mosaic, reproject) using GDAL or MRT, performed with ?runGdal or ?runMrt functions.
and some further processing mainly thought for Time Series:


repDoy # vectorizes the DOY information in the 'day of the year layer'
makeWeights # extracts and encodes QA bit information


# for Time series filtering
whittaker.raster
smooth.spline.raster


The idea is to make data available to other packages (especially to the raster package)


check if calling MODISoptions() the settings "localArcPath", "outDirPath" and "GDAL" and "DEPENDENCIES" are fine. If so proceed:


and If you have already downloaded MODIS data, you can use the function ?orgStruc to MOVE or COPY the data to the standard archive.
orgStruc(from="root/dir/of/data") # it will move or copy all HDF files found under 'from' to options("MODIS_localArcPath") and so available to the MODIS package.
  
As getHdf is integrated in runGdal as first thing try to do something like that:


runGdal(product="MOD13A1",begin="2010001",end="2010030",job="MODIStest")
# a window will pop-up to select the area (see the "extent" argument)
# see arguments in runGdal. Most important: SDSstring, outProj (prj4).


see the result in dir:
options("MODIS_outDirPath")


Last week I did major changes, so the package defaults are printed out very often...but the functionality should be hopefully fine!


Matteo






>>> Wesley Roberts  12/10/12 3:28 PM >>>
Many thanks Matteo,

I downloaded the file and installed the zip to my local R directory. Am
busy trying to figure out how the package works.

My workflow is very simple, I would like to download some MODIS Albedo and
EVI data to conduct a Change Vector Analysis for our study area. I am able
to undertake the exercise using standard gdal, grass, qgis tools however, I
would like to try and accomplish the task using an R script only. As such I
would like all of the processing to be done within the R script.


Do you have any example scripts I could use to become more familiar with
the tools? I have the manual and will use that for now.

Many thanks,
Wesley


On Mon, Dec 10, 2012 at 3:48 PM, Matteo Mattiuzzi <
matteo.mattiuzzi at boku.ac.at> wrote:

> Dear Wesley,
>
>
> You may give a try to the MODIS package. Currently it has build problems
> in R-Forge but you can also install ZIP or TAR from here:
> https://www.dropbox.com/sh/18t0rgcm6bga7xt/-4k_Xwojxr/MODIS
>
>
> If you just want to download the data you are fine with that. If you want
> to also process the data and you use Windows, you need a GDAL with HDF4
> driver (FWTools or OSgeos4W).
> http://trac.osgeo.org/osgeo4w/ (
> http://download.osgeo.org/osgeo4w/osgeo4w-setup.exe)
> or
> http://fwtools.maptools.org/ (http://home.gdal.org/fwtools/FWTools247.exe)
>
>
> If basic settings (like the location of the local HDF archieve) are fine
> see ?MODISoptions, you can proceed directly to the processing see:
> ?runGdal().
>
>
> Matteo
>
>
> >>> Wesley Roberts  12/10/12 2:30 PM >>>
> Dear R-Sig-Geo,
>
>
> I am currently using a script I downloaded from the
> spatial-analyst.netwebsite to download and mosaic a couple of MODIS
> Tiles for my study area (
>
> http://spatial-analyst.net/wiki/index.php?title=Download_and_resampling_of_MODIS_images
> )
>
> I have managed to get as far as the first wget request and am receiving the
> following error.
>
> > download.file(paste(MOD13A3, dates$dirname[[i]], "/", BLOCK1,sep=""),
> destfile=paste(getwd(), "/", BLOCK1, sep=""), mode='wb', method='wget',
> quiet=T, cacheOK=FALSE)
> cygwin warning:
>   MS-DOS style path detected:
> C:/Users/biocarbon/Documents/MOD13A3.A2001091.h20v09.005.2007112114336.hdf
>   Preferred POSIX equivalent is:
>
> /cygdrive/c/Users/biocarbon/Documents/MOD13A3.A2001091.h20v09.005.2007112114336.hdf
>   CYGWIN environment variable option "nodosfilewarning" turns off this
> warning.
>   Consult the user's guide for more details about POSIX paths:
>     http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
> Warning messages:
> 1: running command 'wget --quiet --cache=off "
>
> ftp://e4ftl01.cr.usgs.gov/MOLT/MOD13A3.005/2001.05.01/MOD13A3.A2001091.h20v09.005.2007112114336.hdf
> "
> -O
>
> "C:/Users/biocarbon/Documents/MOD13A3.A2001091.h20v09.005.2007112114336.hdf"'
> had status 8
> 2: In download.file(paste(MOD13A3, dates$dirname[[i]], "/", BLOCK1,  :
>   download had nonzero exit status
>
>
> I presume wget is working correctly and that I have specified the correct
> server credentials as per the original example code. I am currently
> manually downloading data using FileZilla so I presume the server is
> working. Is wget allowed to access data on this server? If not are there
> other tools I can use to download the data?
>
> Any help on the above mentioned error would be greatly appreciated.
>
> Many thanks and kind regards,
> Wesley
>
>
> --
> Dr Wesley Roberts
> jwesroberts at gmail.com
> Cell: +27(0)83 5355 646
> skype: roberts-w
>
>     [[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
>
>
>


-- 
Dr Wesley Roberts
jwesroberts at gmail.com
Cell: +27(0)83 5355 646
skype: roberts-w



More information about the R-sig-Geo mailing list