GDAL

Public Member Functions | List of all members
GDALDimension Class Reference

Class modeling a a dimension / axis used to index multidimensional arrays. More...

`#include <gdal_priv.h>`

## Public Member Functions
const std::string & | GetName () const
| Return the name. More...
const std::string & | GetFullName () const
| Return the full name. More...
const std::string & | GetType () const
| Return the axis type. More...
const std::string & | GetDirection () const
| Return the axis direction. More...
GUInt64 | GetSize () const
| Return the size, that is the number of values along the dimension. More...
virtual std::shared_ptr< GDALMDArray > | GetIndexingVariable () const
| Return the variable that is used to index the dimension (if there is one). More...
virtual bool | SetIndexingVariable (std::shared_ptr< GDALMDArray > poIndexingVariable)
| Set the variable that is used to index the dimension. More...
virtual bool | Rename (const std::string &osNewName)
| Rename the dimension. More...

## Detailed Description

Class modeling a a dimension / axis used to index multidimensional arrays.

It has a name, a size (that is the number of values that can be indexed along the dimension), a type (see GDALDimension::GetType()), a direction (see GDALDimension::GetDirection()), a unit and can optionally point to a GDALMDArray variable, typically one-dimensional, describing the values taken by the dimension. For a georeferenced GDALMDArray and its X dimension, this will be typically the values of the easting/longitude for each grid point.

Since
  GDAL 3.1

## Member Function Documentation

## ◆ GetDirection()

const std::string & GDALDimension::GetDirection | ( |  | ) | const
| inline

Return the axis direction.

Predefined values are: EAST, WEST, SOUTH, NORTH, UP, DOWN, FUTURE, PAST Other values might be returned. Empty value means unknown.

This is the same as the C function GDALDimensionGetDirection()

## ◆ GetFullName()

const std::string & GDALDimension::GetFullName | ( |  | ) | const
| inline

Return the full name.

This is the same as the C function GDALDimensionGetFullName()

## ◆ GetIndexingVariable()

std::shared_ptr< GDALMDArray > GDALDimension::GetIndexingVariable | ( |  | ) | const
| virtual

Return the variable that is used to index the dimension (if there is one).

This is the array, typically one-dimensional, describing the values taken by the dimension.

## ◆ GetName()

const std::string & GDALDimension::GetName | ( |  | ) | const
| inline

Return the name.

This is the same as the C function GDALDimensionGetName()

## ◆ GetSize()

GUInt64 GDALDimension::GetSize | ( |  | ) | const
| inline

Return the size, that is the number of values along the dimension.

This is the same as the C function GDALDimensionGetSize()

## ◆ GetType()

const std::string & GDALDimension::GetType | ( |  | ) | const
| inline

Return the axis type.

Predefined values are: HORIZONTAL_X, HORIZONTAL_Y, VERTICAL, TEMPORAL, PARAMETRIC Other values might be returned. Empty value means unknown.

This is the same as the C function GDALDimensionGetType()

## ◆ Rename()

bool GDALDimension::Rename | ( | const std::string & | osNewName | ) |
| virtual

Rename the dimension.

This is not implemented by all drivers.

Drivers known to implement it: MEM, netCDF, ZARR.

This is the same as the C function GDALDimensionRename().

Parameters

  osNewName | New name.

Returns
  true in case of success

Since
  GDAL 3.8

## ◆ SetIndexingVariable()

bool GDALDimension::SetIndexingVariable | ( | std::shared_ptr< GDALMDArray > | poArray | ) |
| virtual

Set the variable that is used to index the dimension.

This is the array, typically one-dimensional, describing the values taken by the dimension.

Optionally implemented by drivers.

Drivers known to implement it: MEM.

Parameters

  poArray | Variable to use to index the dimension.

Returns
  true in case of success.

The documentation for this class was generated from the following files:

- gdal_priv.h
- gdalmultidim.cpp