runGdal.Rd 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. % Generated by roxygen2: do not edit by hand
  2. % Please edit documentation in R/runGdal.R
  3. \name{runGdal}
  4. \alias{runGdal}
  5. \title{Process MODIS HDF with GDAL}
  6. \usage{
  7. runGdal(product, collection = NULL, begin = NULL, end = NULL,
  8. extent = NULL, tileH = NULL, tileV = NULL, SDSstring = NULL,
  9. job = NULL, checkIntegrity = TRUE, forceDownload = TRUE,
  10. overwrite = FALSE, ...)
  11. }
  12. \arguments{
  13. \item{product}{\code{character}, see \code{\link{getProduct}}.}
  14. \item{collection}{\code{character} or \code{integer}, see
  15. \code{\link{getCollection}}.}
  16. \item{begin}{\code{character}. Begin date of MODIS time series, see
  17. \code{\link{transDate}} for formatting.}
  18. \item{end}{Same for end date.}
  19. \item{extent}{Extent information, defaults to \code{'global'}. See
  20. \code{\link{getTile}}.}
  21. \item{tileH}{\code{numeric} or \code{character}. Horizontal tile number,
  22. see \code{\link{getTile}}.}
  23. \item{tileV}{\code{numeric} or \code{character}. Vertical tile number(s),
  24. see \code{tileH}.}
  25. \item{SDSstring}{\code{character}, see \code{\link{getSds}}.}
  26. \item{job}{\code{character}. Name of the current job for the creation of the
  27. output folder. If not specified, it is created in 'PRODUCT.COLLECTION_DATETIME'.}
  28. \item{checkIntegrity}{\code{logical}, see \code{\link{getHdf}}.}
  29. \item{forceDownload}{\code{logical}, see \code{\link{getHdf}}.}
  30. \item{overwrite}{\code{logical}, defaults to \code{FALSE}. Determines
  31. whether or not to overwrite existing SDS output files.}
  32. \item{...}{Additional arguments passed to \code{MODIS:::combineOptions()} (eg
  33. 'wait'), see also \code{\link{MODISoptions}}.}
  34. }
  35. \value{
  36. A \code{list} of the same length as 'product'. Each product slot holds a
  37. sub-\code{list} of processed dates which, for each time step, include the
  38. corresponding output files as \code{character} objects.
  39. }
  40. \description{
  41. Downloads MODIS grid data from archive (FTP or local) and processes the
  42. files.
  43. }
  44. \details{
  45. \describe{
  46. \tabular{rll}{
  47. \tab \code{outProj}\tab CRS/ prj4 or EPSG code of output, any format supported by gdal see examples.\cr \tab \tab Default is 'asIn' (no warping). See \code{?MODISoptions}.\cr
  48. \tab \code{pixelSize}\tab Numeric single value. Output pixel size in target reference system unit.\cr \tab \tab Default is 'asIn'. See \code{?MODISoptions}.\cr
  49. \tab \code{resamplingType}\tab Character. Default is 'near', can be one of: 'bilinear', 'cubic', 'cubicspline', 'lanczos'.\cr \tab \tab See \code{?MODISoptions}.\cr
  50. \tab \code{blockSize}\tab integer. Default \code{NULL} that means the stripe size is set by GDAL.\cr \tab \tab Basically it is the "-co BLOCKYSIZE=" parameter. See: http://www.gdal.org/frmt_gtiff.html\cr
  51. \tab \code{compression}\tab logical. Default is \code{TRUE}, compress data with the lossless LZW compression with "predictor=2".\cr \tab \tab See: \url{http://www.gdal.org/frmt_gtiff.html}\cr
  52. \tab \code{dataFormat}\tab Data output format, see \code{getOption("MODIS_gdalOutDriver")} column 'name'.\cr
  53. \tab \code{localArcPath}\tab Character. See \code{?MODISoptions}. Local path to look for and/or to download MODIS files.\cr
  54. \tab \code{outDirPath}\tab Character. See \code{?MODISoptions}. Root directory where to write \code{job} folder.\cr
  55. }
  56. }
  57. \code{\link{runGdal}} uses a lot of \strong{MODIS} package functions, see in
  58. section Arguments and Methods the respective '?function' for details and
  59. inputs.\cr
  60. If \code{extent} is a \code{Raster*} object, the output has exactly the same
  61. extent, pixel size, and projection.\cr
  62. If \code{extent} is a \strong{sp} object (i.e., polygon shapefile), the
  63. output has exactly the same extent and projection.\cr
  64. If \code{tileH} and \code{tileV} are used (instead of \code{extent}) to
  65. define the area of interest, and \code{outProj} and \code{pixelSize} are
  66. \code{'asIn'}, the result is only converted from multilayer-HDF to
  67. \code{dataFormat}, default "GeoTiff" (\code{\link{MODISoptions}}).\cr
  68. }
  69. \note{
  70. You need to have a GDAL installed on your system!\cr
  71. \url{http://www.gdal.org/gdal_utilities.html}\cr\cr
  72. On Unix-alkes, install 'gdal-bin' (i.e. Ubuntu: 'sudo apt-get install gdal-bin')\cr
  73. On Windows, you need to install GDAL through OSGeo4W
  74. (\url{http://trac.osgeo.org/osgeo4w/}) or FWTools
  75. (\url{http://fwtools.maptools.org/}) since the standard GDAL does not support
  76. HDF4 format.
  77. }
  78. \examples{
  79. \dontrun{
  80. # LST in Austria
  81. runGdal( product="MOD11A1", extent="austria", begin="2010001", end="2010005", SDSstring="101")
  82. # LST with interactiv area selection
  83. runGdal( product="MOD11A1", begin="2010001", end="2010005", SDSstring="101")
  84. ### outProj examples
  85. # LST of Austria warped to UTM 34N (the three different possibilites to specify "outProj")
  86. # to find am EPSG or prj4 you may use: prj <- make_EPSG() See
  87. runGdal( job="LSTaustria", product="MOD11A1", extent="Austria", begin="2010001", end="2010005",
  88. SDSstring="101", outProj="EPSG:32634")
  89. runGdal( job="LSTaustria", product="MOD11A1", extent="Austria", begin="2010001", end="2010005",
  90. SDSstring="101", outProj="32634")
  91. runGdal( job="LSTaustria", product="MOD11A1", extent="Austria", begin="2010001", end="2010005",
  92. SDSstring="101", outProj="+proj=utm +zone=34 +ellps=WGS84 +datum=WGS84 +units=m +no_defs")
  93. ### resamplingType examples
  94. runGdal( job="LSTaustria", product="MOD11A1", extent="Austria", begin="2010001", end="2010005",
  95. SDSstring="1", resamplingType="lanczos", outProj="32634", pixelSize=100)
  96. ### processing entire tiles and keeping Sinusoidal projection
  97. # This corresponds to a format conversion (eos-hdf04 to Geotiff) and
  98. # layer extraction (multi-layer to single layer)
  99. runGdal( job="LSTaustria", product="MOD11A1", tileH=18:19,tileV=4, begin="2010001", end="2010005",
  100. SDSstring="1", outProj="asIn")
  101. }
  102. }
  103. \seealso{
  104. \code{\link{getHdf}}, \code{\link{runMrt}}.
  105. }
  106. \author{
  107. Matteo Mattiuzzi, Florian Detsch
  108. }