org.geotoolkit.referencing.adapters
Class NetcdfAxis

Object
  extended by NetcdfIdentifiedObject
      extended by NetcdfAxis
All Implemented Interfaces:
DiscreteCoordinateSystemAxis, Identifier, CoordinateSystemAxis, IdentifiedObject, ReferenceIdentifier

public class NetcdfAxis
extends NetcdfIdentifiedObject
implements CoordinateSystemAxis, DiscreteCoordinateSystemAxis

Wraps a NetCDF CoordinateAxis1D as an implementation of GeoAPI interfaces.

NetcdfAxis is a view: every methods in this class delegate their work to the wrapped NetCDF axis. Consequently any change in the wrapped axis is immediately reflected in this NetcdfAxis instance. However users are encouraged to not change the wrapped axis after construction, since GeoAPI referencing objects are expected to be immutable.

Since:
3.08
Version:
3.20
Author:
Martin Desruisseaux (Geomatys)
Module:
coverage/geotk-coverageio-netcdf (download)    View source code for this class

Field Summary
 
Fields inherited from interface IdentifiedObject
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY
 
Fields inherited from interface ReferenceIdentifier
CODESPACE_KEY, VERSION_KEY
 
Fields inherited from interface Identifier
AUTHORITY_KEY, CODE_KEY
 
Constructor Summary
NetcdfAxis(CoordinateAxis1D axis)
          Creates a new NetcdfAxis object wrapping the given NetCDF coordinate axis.
 
Method Summary
 CoordinateAxis1D delegate()
          Returns the wrapped NetCDF axis.
 String getAbbreviation()
          Returns the axis abbreviation.
 String getCode()
          Returns the axis name.
 AxisDirection getDirection()
          Returns the axis direction.
static AxisDirection getDirection(CoordinateAxis axis)
          Returns the direction of the given axis.
 double getMaximumValue()
          Returns the axis maximal value.
 double getMinimumValue()
          Returns the axis minimal value.
 Comparable<?> getOrdinateAt(int index)
          Returns the ordinate value at the given index.
 Range<?> getOrdinateRangeAt(int index)
          Returns the range of ordinate values at the given index.
 RangeMeaning getRangeMeaning()
          Returns null since the range meaning is unspecified.
 InternationalString getRemarks()
          Returns the NetCDF description, or null if none.
 Unit<?> getUnit()
          Returns the units, or null if unknown.
 int length()
          Returns the number of ordinates in the NetCDF axis.
 
Methods inherited from class NetcdfIdentifiedObject
equals, getAlias, getAuthority, getCodeSpace, getIdentifiers, getName, getVersion, hashCode, toString, toWKT
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface IdentifiedObject
getAlias, getIdentifiers, getName, toWKT
 

Constructor Detail

NetcdfAxis

public NetcdfAxis(CoordinateAxis1D axis)
Creates a new NetcdfAxis object wrapping the given NetCDF coordinate axis.

Parameters:
axis - The NetCDF coordinate axis to wrap.
Method Detail

delegate

public CoordinateAxis1D delegate()
Returns the wrapped NetCDF axis.

Specified by:
delegate in class NetcdfIdentifiedObject
Returns:
The wrapped NetCDF object on which operations are delegated.

getCode

public String getCode()
Returns the axis name. The default implementation delegates to Variable.getShortName().

Specified by:
getCode in interface Identifier
Specified by:
getCode in class NetcdfIdentifiedObject
See Also:
Variable.getShortName()

getAbbreviation

public String getAbbreviation()
Returns the axis abbreviation. The default implementation returns an acronym of the value returned by Variable.getShortName().

Specified by:
getAbbreviation in interface CoordinateSystemAxis
See Also:
Variable.getShortName()

getDirection

public AxisDirection getDirection()
Returns the axis direction. The default implementation delegates to getDirection(CoordinateAxis).

Specified by:
getDirection in interface CoordinateSystemAxis
See Also:
CoordinateAxis.getAxisType(), CoordinateAxis.getPositive()

getDirection

public static AxisDirection getDirection(CoordinateAxis axis)
Returns the direction of the given axis. This method infers the direction from CoordinateAxis.getAxisType() and CoordinateAxis.getPositive(). If the direction can not be determined, then this method returns AxisDirection.OTHER.

Parameters:
axis - The axis for which to get the direction.
Returns:
The direction of the given axis.

getMinimumValue

public double getMinimumValue()
Returns the axis minimal value. The default implementation delegates to CoordinateAxis1D.getMinValue().

Specified by:
getMinimumValue in interface CoordinateSystemAxis
See Also:
CoordinateAxis1D.getMinValue()

getMaximumValue

public double getMaximumValue()
Returns the axis maximal value. The default implementation delegates to CoordinateAxis1D.getMaxValue().

Specified by:
getMaximumValue in interface CoordinateSystemAxis
See Also:
CoordinateAxis1D.getMaxValue()

getOrdinateAt

public Comparable<?> getOrdinateAt(int index)
                            throws IndexOutOfBoundsException
Returns the ordinate value at the given index. This method delegates to the first suitable NetCDF method in the following list:

Specified by:
getOrdinateAt in interface DiscreteCoordinateSystemAxis
Parameters:
index - The index at which to return the ordinate value.
Returns:
The ordinate value at the given index as a Number, Date or String.
Throws:
IndexOutOfBoundsException - If the given index is outside the [0 … length-1] range.
Since:
3.15

getOrdinateRangeAt

public Range<?> getOrdinateRangeAt(int index)
                            throws IndexOutOfBoundsException,
                                   UnsupportedOperationException
Returns the range of ordinate values at the given index.

Specified by:
getOrdinateRangeAt in interface DiscreteCoordinateSystemAxis
Parameters:
index - The index at which to return the range of ordinate values.
Returns:
The range of ordinate values at the given index.
Throws:
IndexOutOfBoundsException - If the given index is outside the [0 … length-1] range.
UnsupportedOperationException - if the axis is not numeric.
Since:
3.15

length

public int length()
Returns the number of ordinates in the NetCDF axis. This method delegates to the Variable.getShape(int) method.

Specified by:
length in interface DiscreteCoordinateSystemAxis
Returns:
The number or ordinates in the NetCDF axis.
Since:
3.15

getRangeMeaning

public RangeMeaning getRangeMeaning()
Returns null since the range meaning is unspecified.

Specified by:
getRangeMeaning in interface CoordinateSystemAxis

getUnit

public Unit<?> getUnit()
Returns the units, or null if unknown.

Specified by:
getUnit in interface CoordinateSystemAxis
See Also:
CoordinateAxis.getUnitsString(), Units.valueOf(String)

getRemarks

public InternationalString getRemarks()
Returns the NetCDF description, or null if none. The default implementation delegates to VariableDS.getDescription().

Specified by:
getRemarks in interface IdentifiedObject
Overrides:
getRemarks in class NetcdfIdentifiedObject
See Also:
VariableDS.getDescription()


Copyright © 2009-2012 Geotoolkit.org. All Rights Reserved.