db.write.format {RGeostats}R Documentation

Dump the contents of a Db into a specific file

Description

Dump the contents of a Db into a specific file

Usage

db.write.format(db, mode="csv", file=NA, name=NA, must.noproj=TRUE,
	 nsamplex=1, nsampley=1, nmult=1, flag.low=0, flag.high=1,
	 valmin=NA, valmax=NA, append=FALSE,
	 ncolor=NA, red=NA, green=NA, blue=NA,
	 mask_red=  0, mask_green=  0, mask_blue=  0,
	 ffff_red=232, ffff_green=232, ffff_blue=  0,
	 low_red =255, low_green =255, low_blue =255,
	 high_red=255, high_green=  0, high_blue=  0,
	 sep=",",dec=".", colors=rg.colors(), colorscale.file=NA,
   na.value=-99999999999)

Arguments

db

The db-class to be dumped

mode

Format used for the dump:

  • "csv" : for the Comma Separated Version of the dump (for compatibility with Excel program)

  • "irap" : for the dump of one variable of a Grid Db according to the IRAP format

  • "zycor" : for the dump of the contents of a Grid Db according to the ZYCOR format

  • "vtk" : for the dump of the contents of a Db according to the VTK format. It can be Grid or Point. The resulting file is ASCII but you can set it to Binary using: set.keypair("VTK_Use_Binary",1)

  • "bmp" : for the dump of the contents of a Grid Db according to the BMP Bit Map format

  • "png" : for the dump of the contents of a Grid Db according to the PNG Portable Network Graphic format

  • "prop" : for the dump of one or several proportion variables stored in a separate file according to .PROP IFPEN format

  • "eclipse" : for the dump of the contents of a Grid stored in a separate file according to the Eclipse format

  • "geotiff" : for the dump of the contents of a 2-D Grid stored in a seperate file according to GeoTiff format

  • "shape" Point stored in a spearate file according to the ShapeFile format

file

Name of the file where the contents of the Db will be dumped out. If not defined, the file name is generated automatically as 'RGeostats.<ext>' where <ext> is the corresponding mode extension.

name

Name of the variable(s) to be dumped. If CSV format is used, several variables can be specified: if the argument name is not provided, all the variables are dumped. For all other formats, only one variable name is authorized.

must.noproj

When TRUE, the data contained in the Db are NOT translated before they are printed in the auxiliary file

nsamplex

Sampling ratio along the X axis. When equal to 1, all samples are displayed. When equal to 2, one sample out of two is represented. Only used for IRAP and BMP.

nsampley

Sampling ratio along the Y axis. When equal to 1, all samples are displayed. When equal to 2, one sample out of two is represented. Only used for IRAP and BMP.

nmult

Magnification factor used in the BMP output.

flag.low

When 1, a grid cell where the value is smaller than 'valmin' is represented using the 'lower' color. Otherwise, it is represented with the first color of the color scale. Only used for BMP.

flag.high

When 1, a grid cell where the value is larger than 'valmax' is represented using the 'upper' color. Otherwise, it is represented with the last color of the color scale. Only used for BMP.

valmin

Minimum value corresponding to the first color in the color scale. If NA, this value is calculated from the represented grid values. Only used for BMP, PNG and GEOTIFF.

valmax

Maximum value corresponding to the last color in the color scale. If NA, this value is calculated from the represented grid values. Only used for BMP, PNG and GEOTIFF.

append

When the CSV format is used, and if this flag is switched ON, the contents of the current dump is concatenated to an already existing file (No error occurs if the file does not already exist). When this flag is switched OFF, the current dump replaces the previous contents of the file.

ncolor

Number of colors which define the color scale. If not provided, a grey color scale constructed automatically with 256 levels is used. When ncolor is positive, the user should provide the array of indices for the basic three colors: red, green and blue. Only used for BMP.

red

When ncolor>0, this array contains the indices for the red channel (between 0 and 255) for each color. Dimension should be ncolor. Only used for BMP.

green

When ncolor>0, this array contains the indices for the green channel (between 0 and 255) for each color. Dimension should be ncolor.

blue

When ncolor>0, this array contains the indices for the blue channel (between 0 and 255) for each color. Dimension should be ncolor. Only used for BMP.

mask_red,mask_green,mask_blue

Definition of the 'mask' color used for the masked sample. Only used for BMP.

ffff_red,ffff_green,ffff_blue

Definition of the 'ffff' color used for the undefined sample. Only used for BMP.

low_red,low_green,low_blue

Definition of the 'lower' color used for the a sample lower than 'valmin' (if flag.low=1) Only used for BMP.

high_red,high_green,high_blue

Definition of the 'upper' color used for the a sample larger than 'valmax' (if flag.high=1) Only used for BMP.

sep,dec

Definition of the parameters used by function write.table in the case of mode=CSV

colors

Colorscale to be used for interpolating values between valmin and valmax. For GEOTIFF, if a colorscale text file is provided with colors.file, it is used in priority (see util.write.colors). Only used for PNG and GEOTIFF.

colorscale.file

Colorscale text file generated using util.write.colors function. If not provided, a colorscale file is automatically generated. Only used for GEOTIFF.

na.value

NA value used for generating Geotiff image. This value must be identical to the one used for the colorscale file generated by util.write.colors function. Only used for GEOTIFF.

Details

In VTK, we can distord the coordinates by using the following statement: set.keypair("VTK_Fact_X",1) set.keypair("VTK_Fact_Y",1) set.keypair("VTK_Fact_Z",1)

Value

An ASCII file corresponding to the selected format.

See Also

db-class,


[Package RGeostats version 14.0.10 Index]