| zarr_convention_cs | R Documentation |
This class implements the GeoZarr "cs" (coordinate set) convention. The convention attaches a full coordinate system to a Zarr array by recording, for each dimension, the axis abbreviation and direction, one or more sets of coordinate values and their optional cell-boundary values, and, where applicable, the parametric formula and its terms needed to derive physical coordinates from stored index coordinates.
The convention is registered via the following CMO:
{
"schema_url": "https://raw.githubusercontent.com/R-CF/zarr_convention_cs/main/schema.json",
"spec_url": "https://raw.githubusercontent.com/R-CF/zarr_convention_cs/main/README.md",
"uuid": "e4dbf0b7-7a00-4ce6-b23e-484292014ab4",
"name": "cs",
"description": "Coordinate set convention for Zarr arrays"
}
The cs attribute written to the array metadata has the following
structure (simplified):
{
"cs": {
"crs": [
{
"type": "compound" | "planar" | "vertical" | "temporal" | "undefined",
"description: "optional text",
"axes": {
"<dimension_name>": {
"abbreviation": "X",
"direction": "EAST",
"coordinates": [ { "unit": "degrees",
"values": { "regular": [0.0, 0.5] } } ]
}
}
}
],
"id": "Identifier of a compound CRS",
"attributes": { <optional attributes as a JSON sub-schema> }
}
}
Build a convention instance, add one or more CRS objects (each covering
one or more dimension axes), then call as_list() to retrieve everything
for inclusion as the "cs" attribute in the Zarr node metadata.
zarr::zarr_convention -> zarr_convention_cs
nameOptional descriptive name for the coordinate set.
cs_crsOptional top-level CRS identifier, an instance of zarr_conv_proj.
crs(read-only) The list of CRS objects accumulated so far.
zarr_convention_cs$new()Create a new instance of a "cs" convention agent.
zarr_convention_cs$new()
A new instance of a "cs" convention agent.
zarr_convention_cs$add_crs()Add a CRS object to this coordinate set. Each CRS covers one or more axes (dimensions). Multiple calls add further CRS objects to the array, which is necessary when the array spans domains described by separate OGC coordinate reference systems (e.g. a horizontal CRS plus a vertical CRS plus a temporal CRS).
zarr_convention_cs$add_crs( axes, type = "unknown", id = NULL, geolocation = NULL )
axesA named list of axis definitions, keyed by the dimension name
that appears in the Zarr array's dimension_names metadata. If the
argument is NULL or an empty list, the call is a no-op.
typeOptional, character string. Type of CRS, one of "compound", "planar", "vertical", "temporal", "unknown" (default).
idOptional. An instance of zarr_conv_proj providing the formal OGC description of the CRS.
geolocationOptional list. Geolocation grid definition for curvilinear grids. This should only be included for CRS's that represent a planar coordinate system.
Self, invisibly.
zarr_convention_cs$as_list()Retrieve the cs attributes as a list.
zarr_convention_cs$as_list()
A list with the updated attributes for this convention.
zarr_convention_cs$axis()Build an axis definition.
zarr_convention_cs$axis(coordinates, abbreviation = NULL, direction = NULL)
coordinatesA list of coordinate-set definitions, each produced by
coordinates(). Must have at least one element.
abbreviationOptional character string. Axis abbreviation, e.g.
"X", "Y", "Z", or "T".
directionOptional character string. Direction of increasing
coordinate values taken from Table 48 of the OGC standard "Referencing
by Coordinates" (e.g. "EAST", "NORTH", "UP", "FUTURE").
A named list representing one axis entry.
zarr_convention_cs$coordinates()Build a coordinate-set definition for use in axis().
zarr_convention_cs$coordinates( values, name = NULL, unit = NULL, boundaries = NULL, parametric = NULL, time = NULL, attributes = NULL )
valuesA values definition produced by one of values_regular(),
values_explicit(), or values_external().
nameOptional, character string. Descriptive name for this set of coordinates.
unitOptional, character string. Unit of measure (e.g.
"degrees_east", "m", "1").
boundariesOptional boundaries definition produced by
boundaries_regular() or values_external().
parametricOptional parametric definition produced by
parametric().
timeOptional time definition produced by time().
attributesOptional list with attributes for the coordinates.
A named list representing one coordinates entry.
zarr_convention_cs$values_regular()Regularly-spaced coordinate values.
zarr_convention_cs$values_regular(start, increment)
startNumeric. The coordinate value at shape index 0.
incrementNumeric. The constant spacing between successive values. May be negative for decreasing coordinates (e.g. north-to-south latitudes); it cannot be 0.
A values list with a regular element.
zarr_convention_cs$values_explicit()Explicitly listed coordinate values.
zarr_convention_cs$values_explicit(values)
valuesA vector of coordinate values. May be numeric, integer, or character.
A values list with an explicit element.
zarr_convention_cs$values_external()Coordinate values stored in an external array
zarr_convention_cs$values_external(node, uri)
nodeCharacter string. Path to the 1-dimensional Zarr array containing the coordinate values, relative to the referring node.
uriOptional character string. URI of an external store. Omit for arrays in the same local store.
A values list with an external element.
zarr_convention_cs$boundaries_regular()Regularly-spaced cell-boundary values.
The two values give the offset below and above the coordinate value
that define the extent of each cell, in the same unit as the
coordinates. Both offsets are expressed relative to the coordinate value
so below must be non-positive and above must be non-negative.
zarr_convention_cs$boundaries_regular(below, above)
below, aboveNumeric. Offset from the coordinate value to the lower and upper boundary, respectively.
A boundaries list with a regular element.
zarr_convention_cs$time()Provides the time reference information needed to interpret numeric coordinate values on a temporal axis.
zarr_convention_cs$time(unit, epoch, calendar = NULL)
unitCharacter string. The time unit, e.g. "days", "hours",
"seconds".
epochCharacter string. The reference date/time in ISO 8601
format, e.g. "1970-01-01".
calendarOptional character string. The CF calendar name, e.g.
"standard", "360_day". Defaults to "proleptic_gregorian" when
omitted.
A time list.
zarr_convention_cs$parametric()Records the CF formula name and the set of formula terms
needed to derive physical coordinates from the stored parametric index
coordinates. This object sits alongside values inside a
coordinates() call; values provides the stored parametric
coordinates (e.g. s_rho), while parametric provides the machinery
to recover the physical coordinates (e.g. depth in metres).
zarr_convention_cs$parametric(formula, terms)
formulaCharacter string. The CF standard_name of the parametric
coordinate formula, e.g. "ocean_s_coordinate_g2".
termsA named list of formula term values. Each element must be a
values attribute object. Scalar or short constants should use
explicit coordinate values; full-length arrays should use external Zarr
arrays.
A parametric list.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.