Description Usage Arguments Details Value Warning Author(s) References Examples
Warps (mosaic, reproject, resample), raster files to a projection set by the
user. The function works by calling gdalwarp
, which needs to be
installed on the system.
1 2 |
x |
character or list of character, the filenames of files to be
warpped. The list can easily be retrieved using a call such as
|
t_srs |
character. proj4 expression of the output ( |
nodata |
numeric. Value that should not get interpolated in the
resampling. Can take multiple values (i.e.: |
filename |
character. filename of the output file, with full path. |
res |
numeric. output resolution. |
method |
character. resampling method. See http://www.gdal.org/gdalwarp.html |
mc.cores |
Numeric. Only relevant if |
run |
logical. should the warping be executed. If set to false, a gdalwarp command string is generated, but not executed. |
... |
Extra switches passed to |
Requires gdal to be installed on the system, and the the gdal binary folder should be added to the system path. On windows systems, gdal can be install via FWTools, OSGeo4W or QGIS.
A character, the gdalwarp command. If you inted to copy/past it in a
terminal, you can use print()
, with quote=FALSE
.
For parallel implementation, see warning section of
mclapply
Loic Dutrieux
http://www.gdal.org/gdalwarp.html
1 2 3 4 5 6 7 8 9 10 11 12 | ## Not run:
pr <- getPR('Belize')
pr
dir = tempdir()
downloadPR(pr, year=2000, dir=dir)
unpackVCF(pr=pr, year=2000, searchDir=dir, dir=sprintf('%s/%s',dir,'extract/'))
x <- list.files(sprintf('%s/%s',dir,'extract/'), full.names=TRUE)
filename <- sprintf('%s.tif', rasterTmpFile())
warpVCF(x=x, t_srs='+proj=laea +lat_0=-10 +lon_0=-70 +x_0=0 +y_0=0 +a=6370997 +b=6370997 +units=m +no_defs', nodata = c(200, 210, 211, 220), filename=filename, '-multi')
a <- raster(filename)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.