org.geotoolkit.referencing.datum
Class DefaultVerticalDatum

Object
  extended by FormattableObject
      extended by AbstractIdentifiedObject
          extended by AbstractDatum
              extended by DefaultVerticalDatum
All Implemented Interfaces:
Serializable, Formattable, LenientComparable, Datum, VerticalDatum, IdentifiedObject

@Immutable
public class DefaultVerticalDatum
extends AbstractDatum
implements VerticalDatum

A textual description and/or a set of parameters identifying a particular reference level surface used as a zero-height surface. The description includes its position with respect to the Earth for any of the height types recognized by this standard. There are several types of vertical datums, and each may place constraints on the coordinate system axis with which it is combined to create a vertical CRS.

Since:
1.2
Version:
3.18
Author:
Martin Desruisseaux (IRD, Geomatys)
See Also:
Serialized Form
Module:
referencing/geotk-referencing (download)    View source code for this class

Field Summary
static DefaultVerticalDatum BAROMETRIC
          Default vertical datum for barometric heights.
static DefaultVerticalDatum ELLIPSOIDAL
          Default vertical datum for ellipsoidal heights.
static DefaultVerticalDatum GEOIDAL
          Default vertical datum for geoidal heights.
static DefaultVerticalDatum OTHER_SURFACE
          Default vertical datum for other surface.
 
Fields inherited from class AbstractIdentifiedObject
EMPTY_ALIAS_ARRAY, EMPTY_IDENTIFIER_ARRAY, IDENTIFIER_COMPARATOR, NAME_COMPARATOR, REMARKS_COMPARATOR
 
Fields inherited from class FormattableObject
EPSG, GEOTIFF, INTERNAL, OGC, SINGLE_LINE
 
Fields inherited from interface Datum
ANCHOR_POINT_KEY, DOMAIN_OF_VALIDITY_KEY, REALIZATION_EPOCH_KEY, SCOPE_KEY
 
Fields inherited from interface IdentifiedObject
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY
 
Constructor Summary
DefaultVerticalDatum(Map<String,?> properties, VerticalDatumType type)
          Constructs a vertical datum from a set of properties.
DefaultVerticalDatum(String name, VerticalDatumType type)
          Constructs a vertical datum from a name.
DefaultVerticalDatum(VerticalDatum datum)
          Constructs a new datum with the same values than the specified one.
 
Method Summary
protected  int computeHashCode()
          Computes a hash value for this identified object.
 boolean equals(Object object, ComparisonMode mode)
          Compare this vertical datum with the specified object for equality.
 String formatWKT(Formatter formatter)
          Formats the inner part of a Well Known Text (WKT) element.
 VerticalDatumType getVerticalDatumType()
          The type of this vertical datum.
static VerticalDatumType getVerticalDatumTypeFromLegacyCode(int code)
          Returns the vertical datum type from a legacy code.
static DefaultVerticalDatum wrap(VerticalDatum object)
          Returns a Geotk datum implementation with the same values than the given arbitrary implementation.
 
Methods inherited from class AbstractDatum
getAnchorPoint, getDomainOfValidity, getRealizationEpoch, getScope
 
Methods inherited from class AbstractIdentifiedObject
equals, equals, equals, equals, getAlias, getIdentifier, getIdentifier, getIdentifiers, getName, getName, getName, getProperties, getProperties, getRemarks, hashCode, nameMatches, nameMatches, nameMatches
 
Methods inherited from class FormattableObject
getDefaultIndentation, print, setDefaultIndentation, toString, toWKT, toWKT, toWKT
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface Datum
getAnchorPoint, getDomainOfValidity, getRealizationEpoch, getScope
 
Methods inherited from interface IdentifiedObject
getAlias, getIdentifiers, getName, getRemarks, toWKT
 

Field Detail

BAROMETRIC

public static final DefaultVerticalDatum BAROMETRIC
Default vertical datum for barometric heights.

Since:
3.14

GEOIDAL

public static final DefaultVerticalDatum GEOIDAL
Default vertical datum for geoidal heights.


ELLIPSOIDAL

public static final DefaultVerticalDatum ELLIPSOIDAL
Default vertical datum for ellipsoidal heights. Ellipsoidal heights are measured along the normal to the ellipsoid used in the definition of horizontal datum.


OTHER_SURFACE

public static final DefaultVerticalDatum OTHER_SURFACE
Default vertical datum for other surface.

Since:
3.14
Constructor Detail

DefaultVerticalDatum

public DefaultVerticalDatum(String name,
                            VerticalDatumType type)
Constructs a vertical datum from a name.

Parameters:
name - The datum name.
type - The type of this vertical datum.

DefaultVerticalDatum

public DefaultVerticalDatum(VerticalDatum datum)
Constructs a new datum with the same values than the specified one. This copy constructor provides a way to wrap an arbitrary implementation into a Geotk one or a user-defined one (as a subclass), usually in order to leverage some implementation-specific API. This constructor performs a shallow copy, i.e. the properties are not cloned.

Parameters:
datum - The datum to copy.
Since:
2.2

DefaultVerticalDatum

public DefaultVerticalDatum(Map<String,?> properties,
                            VerticalDatumType type)
Constructs a vertical datum from a set of properties. The properties map is given unchanged to the super-class constructor.

Parameters:
properties - Set of properties. Should contains at least "name".
type - The type of this vertical datum.
Method Detail

wrap

public static DefaultVerticalDatum wrap(VerticalDatum object)
Returns a Geotk datum implementation with the same values than the given arbitrary implementation. If the given object is null, then this method returns null. Otherwise if the given object is already a Geotk implementation, then the given object is returned unchanged. Otherwise a new Geotk implementation is created and initialized to the attribute values of the given object.

Parameters:
object - The object to wrap in a Geotk implementation, or null if none.
Returns:
A Geotk implementation containing the values of the given object (may be the given object itself), or null if the argument was null.
Since:
3.18

getVerticalDatumType

public VerticalDatumType getVerticalDatumType()
The type of this vertical datum. Default is “geoidal”.

Specified by:
getVerticalDatumType in interface VerticalDatum
Returns:
The type of this vertical datum.

getVerticalDatumTypeFromLegacyCode

public static VerticalDatumType getVerticalDatumTypeFromLegacyCode(int code)
Returns the vertical datum type from a legacy code. The legacy codes were defined in Coordinate Transformation Services (OGC 01-009), which also defined the Well Known Text (WKT) format. This method is used for WKT parsing.

Parameters:
code - The legacy vertical datum code.
Returns:
The vertical datum type, or null if the code is unrecognized.

equals

public boolean equals(Object object,
                      ComparisonMode mode)
Compare this vertical datum with the specified object for equality.

Specified by:
equals in interface LenientComparable
Overrides:
equals in class AbstractDatum
Parameters:
object - The object to compare to this.
mode - STRICT for performing a strict comparison, or IGNORE_METADATA for comparing only properties relevant to transformations.
Returns:
true if both objects are equal.

computeHashCode

protected int computeHashCode()
Computes a hash value for this identified object. This method is invoked by AbstractIdentifiedObject.hashCode() when first needed.

Implementation specific feature
In the Geotk implementation, the name, identifiers and remarks are not used for hash code computation. Consequently two identified objects will return the same hash value if they are equal in the sense of equals(…, ComparisonMode.IGNORE_METADATA). This feature allows users to implement metadata-insensitive HashMap.

Overrides:
computeHashCode in class AbstractIdentifiedObject
Returns:
The hash code value. This value may change between different execution of the Geotk library.

formatWKT

public String formatWKT(Formatter formatter)
Formats the inner part of a Well Known Text (WKT) element.

Specified by:
formatWKT in interface Formattable
Overrides:
formatWKT in class AbstractDatum
Parameters:
formatter - The formatter to use.
Returns:
The WKT element name, which is "VERT_DATUM"
See Also:
FormattableObject.toWKT(), FormattableObject.toString()


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