write_bin {rcaiman}R Documentation

Write binarized images

Description

Wrapper functions for terra::writeRaster().

Usage

write_bin(bin, path)

Arguments

bin

SpatRaster.

path

Character vector of length one. Path for writing the image.

Value

No return value. Called for side effects.

See Also

Other Tool Functions: colorfulness(), correct_vignetting(), defuzzify(), extract_dn(), extract_feature(), extract_rl(), extract_sky_points_simple(), extract_sky_points(), extract_sun_coord(), find_sky_pixels_nonnull(), find_sky_pixels(), masking(), optim_normalize(), percentage_of_clipped_highlights(), read_bin(), read_caim_raw(), read_caim(), write_caim()

Examples

## Not run: 
z <- zenith_image(1000, lens())
m <- !is.na(z)
my_file <- file.path(tempdir(), "mask")
write_bin(m, my_file)
my_file <- as.filename(my_file) %>%
  insert(., ext = "tif", replace = TRUE) %>%
  as.character()
m_from_disk <- read_bin(my_file)
plot(m - m_from_disk)

## End(Not run)

[Package rcaiman version 1.2.2 Index]