writebin: Saves geographic data as byte file (".gz")

Description Usage Arguments Author(s) See Also Examples

Description

Saves geographic data as byte file, in gzip compressed format ('.gz'). ATTENTION!! Only 2D (one layer) can be stored!

Usage

1
writebin(satdata,filename,param)

Arguments

satdata

one layer-raster-object or matrix holding spatial data.

param

character string indicating the parameter name for the dataset treatment. See parameter_definitions for available parameters.

filename

character string naming the '.gz'-file to be created.

Author(s)

Robert K. Bauer

See Also

readbin, regions, crop, raster2matrix, param_unconvert

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## Example for selecting wrong area definition when saving files
setwd(system.file("test_files", package="oceanmap"))
gz.files <- Sys.glob('med4*.gz') # load sample-med4'.gz'-files
v(gz.files[1])

fname <- name_split(gz.files[1])
param <- fname$parameter
gz <- readbin(gz.files[1])
dim(gz)
v(gz.files[1])

### reset region name
fname$area <- 'med9'
fname <- name_join(fname)
# writebin(gz,fname,param=param)
# v(fname)
# system(paste('rm', fname))

### multi layer raster file
gz2 <- stack(gz,gz)
# writebin(gz2,rep(gz.files[1],2),param) # error message since multi layer
# writebin(gz,gz.files[1],param) # single layer raster file
# v(gz.files[1])


Search within the oceanmap package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.