gridfile.new

Create a new, empty .grid file


Syntax



Description

obj = gridfile.new(filename, metadata)

Initializes a new (empty) .grid file. The new file manages an N-dimensional grid that spans the provided metadata. Adds a “.grid” extension to the filename if it does not already have one.

obj = gridfile.new(…, overwrite)
obj = gridfile.new(…, true|”o”|”overwrite”)
obj = gridfile.new(…, false|”p”|”preserve”)

Specify whether the method may overwrite pre-existing .grid files. By default, the method will not overwrite files.


Input Arguments

filename

string scalar
The name of the new .grid file. May be a filename, relative path, or absolute path. If not an absolute path, saves the new file relative to the current directory.

metadata

gridMetadata object
Metadata for the gridded dataset. Metadata rows must be unique for each dimension. If the metadata has a set dimension order, the order will be ignored. The metadata object must have at least one dimension with metadata (at least 1 defined dimension).

overwrite

scalar, logical | string
Whether to overwrite existing files

[true|”o”|”overwrite”]: Overwrite any existing file

[false|”p”|”preserve” (Default)]: Do not overwrite an existing file


Output Arguments

obj

gridfile object
A gridfile object for the new .grid file.