| write_tiff | R Documentation |
The data must contain x and y columns (pixel center coordinates) and
one or more numeric band columns. Grid dimensions and geotransform are
inferred from the x/y coordinate arrays. Missing pixels are written as NaN
(or the type-appropriate nodata value for integer pixel types).
write_tiff(
x,
path,
compress = FALSE,
pixel_type = "float64",
metadata = NULL,
crs = NULL,
tiled = FALSE,
tile_size = 256L,
bigtiff = "auto",
...
)
x |
A |
path |
File path for the output GeoTIFF file. |
compress |
Logical; use DEFLATE compression? Default |
pixel_type |
Character string specifying the output pixel type.
One of |
metadata |
Optional character string of GDAL_METADATA XML to embed
in the file (tag 42112). Use |
crs |
Optional CRS to embed as a GeoKey directory (TIFF tag 34735).
Accepts an integer EPSG code, an |
tiled |
Logical; write a tiled GeoTIFF (TIFF tags 322/323/324/325)
instead of strips. Default |
tile_size |
Integer; tile edge length in pixels. Must be a positive
multiple of 16 (TIFF spec). Either a single value (square tiles) or a
length-2 vector |
bigtiff |
Controls BigTIFF dispatch. |
... |
Reserved for future use. |
Invisible NULL.
# Write as int16 with DEFLATE compression and an EPSG:4326 GeoKey
df <- data.frame(x = 1:4, y = rep(1:2, each = 2), band1 = c(100, 200, 300, 400))
f <- tempfile(fileext = ".tif")
write_tiff(df, f, compress = TRUE, pixel_type = "int16", crs = 4326L)
tiff_crs(f)
unlink(f)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.