View source: R/gdal-utils-helpers.R
| ts_te | R Documentation |
Format grid properties for GDAL command line options (-ts for target size,
-te for target extent).
ts_te(dimension, extent)
gdal_te(extent)
gdal_ts(dimension)
dimension |
integer vector of ncol, nrow (target size) |
extent |
numeric vector of xmin, xmax, ymin, ymax (target extent) |
These functions generate the string arguments used by GDAL utilities like
gdalwarp and gdal_translate. The gdal_ts() function is named after the GDAL
-ts flag and gdal_te() after the GDAL -te flag.
A character string formatted for GDAL command line:
ts_te(): combined -ts and -te arguments
gdal_ts(): -ts ncol nrow string
gdal_te(): -te xmin ymin xmax ymax string (note: reordered for GDAL)
vcrop() for computing aligned extents
ts_te(c(10, 100), 1:4)
gdal_ts(c(10, 100))
gdal_te(1:4)
## use in a GDAL command (not run)
## Not run:
cmd <- sprintf("gdalwarp %s %s input.tif output.tif",
gdal_ts(c(1000, 500)), gdal_te(c(-180, 180, -90, 90)))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.