Coordinates: Coordinates

CoordinatesR Documentation

Coordinates

Description

This class implements the coordinates class. The coordinates are always associated with a coordinate system axis.

This class provides the basic interface for coordinate values and it manages numeric coordinate values, both integer and floating-point. Descendant classes manage packed numerical values, character values and time values.

The optional boundary values for numeric coordinate values that define the finite extent of each element in the coordinates are also managed by this class.

Super class

zarr::zarr_object -> Coordinates

Active bindings

name

Set or retrieve the name of the coordinate set.

direction

Set or retrieve the direction of the coordinates.

values

(read-only) Retrieve the coordinate values as a full vector of values.

raw

(read-only) Retrieve the coordinate values as stored, either a full vector or packed.

bounds

Set or retrieve the boundary values around coordinates. When setting, assign a matrix with 2 rows and as many columns as there are coordinates values. When retrieving, a matrix as just described or NULL if boundary values have not been set.

bounds_raw

(read-only) Retrieve the boundary values around coordinates exactly as they are stored with the coordinate. If the boundary values are packed, a vector of length 2 is returned, otherwise a matrix with 2 rows and as many columns as there are coordinates values or NULL if boundary values have not been set.

range

(read-only) Retrieve the extreme values of the coordinates.

length

(read-only) The number of elements in this instance once the values are unpacked.

unit

Character string giving the unit-of-measure of the coordinate values.

attributes

(read-only) A named list with the attributes of this object.

Methods

Public methods

Inherited methods

Coordinates$new()

Create a new coordinates instance for use with a coordinate system axis.

Usage
Coordinates$new(
  name,
  direction,
  unit,
  values,
  bounds = NULL,
  attributes = list()
)
Arguments
name

Character string. Name of the coordinate set.

direction

Character string. Direction of the coordinates. Must be one from the set of values given in AxisDirection.

unit

Character string. Unit of measure of the coordinates.

values

A vector of values.

bounds

Optional. If the boundaries are regularly spaced, a vector with the offset to the boundary lower and higher than the coordinate value, respectively. Otherwise, a matrix with two rows and as many columns as there are elements, with the offset to the boundary below the coordinate value in row 1 and the offset to the boundary above the coordinate value in row 2. The boundaries represent the finite extent around the boundary value that this value is representative for. If this argument is not provided, the coordinate values are assumed to represent a point value.

attributes

Optional. A list of attributes of the coordinates.

Returns

An instance of this class or an error.


Coordinates$print()

Print a summary of the coordinates to the console.

Usage
Coordinates$print(...)
Arguments
...

Ignored.

Returns

Self, invisible.


Coordinates$brief()

Some details of the axis.

Usage
Coordinates$brief()
Returns

A 1-row data.frame with some details of the axis.


Coordinates$copy()

Return an exact copy of these coordinates.

Usage
Coordinates$copy()
Returns

A new instance of Coordinates.


Coordinates$subset()

Return coordinates spanning a smaller coordinate range.

Usage
Coordinates$subset(rng)
Arguments
rng

The range of indices to include in the returned coordinates.

Returns

A new Coordinates instance covering the indicated range of indices, including boundary values, present.


Coordinates$slice()

Given a range of domain coordinate values, returns the indices into the axis that fall within the supplied range. If the axis has boundary values, any coordinate whose boundary values fall entirely or partially within the supplied range will be included in the result.

Usage
Coordinates$slice(rng)
Arguments
rng

A numeric vector whose extreme values indicate the indices of coordinates to return.

Returns

An integer vector of length 2 with the lower and higher indices into the axis that fall within the range of coordinates in argument rng. Returns NULL if no (boundary) values of the axis fall within the range of coordinates.


Coordinates$getDirection()

Retrieve the direction of the coordinates. This method is mandatory in the OGC standard for an axis.

Usage
Coordinates$getDirection()
Returns

Character string with the direction of the coordinates.


Coordinates$getUnit()

Retrieve the unit of measure of the coordinates. This method is mandatory in the OGC standard for an axis.

Usage
Coordinates$getUnit()
Returns

Character string with the unit of measure of the axis.


Coordinates$getMinimumValue()

Retrieve the minimum coordinate value of this set of coordinates, in units of the unit of measure of the coordinates.

Usage
Coordinates$getMinimumValue()
Returns

Negative infinity.


Coordinates$getMaximumValue()

Retrieve the maximum coordinate value of this set of coordinates, in units of the unit of measure of the coordinates.

Usage
Coordinates$getMaximumValue()
Returns

Positive infinity.


Coordinates$getRangeMeaning()

Retrieve the interpretation of coordinate values, either as a direct value ("EXACT") or as a wrap-around value between the minimum and maximum value of the coordinates ("WRAPAROUND").

Usage
Coordinates$getRangeMeaning()
Returns

The character string 'EXACT'.


geozarr documentation built on Sept. 16, 2026, 1:07 a.m.