Class VerticalDatumTypes

java.lang.Object
org.apache.sis.internal.referencing.VerticalDatumTypes
All Implemented Interfaces:
org.opengis.util.CodeList.Filter

public final class VerticalDatumTypes extends Object implements org.opengis.util.CodeList.Filter
Extensions to the standard set of VerticalDatumType. Those constants are not in public API because they were intentionally omitted from ISO 19111, and the ISO experts said that they should really not be public.

This class implements CodeList.Filter for opportunist reasons. This implementation convenience may change in any future SIS version.

Since:
0.4
Version:
0.7
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final StringBuilder
    The name of a datum to compare against the list of datum types, in upper-case and (if possible) using US-ASCII characters.
    static final org.opengis.referencing.datum.VerticalDatumType
    A vertical datum for ellipsoidal heights that are measured along the normal to the ellipsoid used in the definition of horizontal datum.
    private static final short[]
    Mapping from VerticalDatumType to the numeric values used in legacy specification (OGC 01-009).
    static final org.opengis.referencing.datum.VerticalDatumType
    A vertical datum for orthometric heights that are measured along the plumb line.
    private static final org.opengis.referencing.datum.VerticalDatumType[]
    Mapping from the numeric values used in legacy specification (OGC 01-009) to VerticalDatumType.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Creates a new CodeList.Filter which will compare the given datum name against the list of datum types.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    accept(org.opengis.util.CodeList<?> code)
    Returns true if the name of the given code is the prefix of a word in the datum name.
    Returns null for disabling the creation of new code list elements.
    static org.opengis.referencing.datum.VerticalDatumType
    fromLegacy(int code)
    Returns the vertical datum type from a legacy code.
    private static org.opengis.referencing.datum.VerticalDatumType
    guess(String name)
    Guesses the type of a datum of the given name.
    static org.opengis.referencing.datum.VerticalDatumType
    guess(String name, Collection<? extends org.opengis.util.GenericName> aliases, org.opengis.referencing.cs.CoordinateSystemAxis axis)
    Guesses the type of a datum from its name, aliases or a given vertical axis.
    static int
    toLegacy(org.opengis.referencing.datum.VerticalDatumType type)
    Returns the legacy code for the datum type, or 0 if unknown.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ELLIPSOIDAL

      public static final org.opengis.referencing.datum.VerticalDatumType ELLIPSOIDAL
      A vertical datum for ellipsoidal heights that are measured along the normal to the ellipsoid used in the definition of horizontal datum.

      Identifier: CS_DatumType.CS_VD_Ellipsoidal

    • ORTHOMETRIC

      public static final org.opengis.referencing.datum.VerticalDatumType ORTHOMETRIC
      A vertical datum for orthometric heights that are measured along the plumb line.

      Identifier: CS_DatumType.CS_VD_Orthometric

    • TYPES

      private static final org.opengis.referencing.datum.VerticalDatumType[] TYPES
      Mapping from the numeric values used in legacy specification (OGC 01-009) to VerticalDatumType. Indices in this array are the legacy codes minus 2000. This array shall not be fill before the above static constants.
    • LEGACY_CODES

      private static final short[] LEGACY_CODES
      Mapping from VerticalDatumType to the numeric values used in legacy specification (OGC 01-009).
    • datum

      private final StringBuilder datum
      The name of a datum to compare against the list of datum types, in upper-case and (if possible) using US-ASCII characters.
  • Constructor Details

    • VerticalDatumTypes

      private VerticalDatumTypes(String name)
      Creates a new CodeList.Filter which will compare the given datum name against the list of datum types. The comparison is case-insensitive and ignores some non-ASCII characters. The exact algorithm applied here is implementation dependent and may change in any future version.
      Parameters:
      name - the datum name.
  • Method Details

    • fromLegacy

      public static org.opengis.referencing.datum.VerticalDatumType fromLegacy(int code)
      Returns the vertical datum type from a legacy code. The legacy codes were defined in OGC 01-009 (Coordinate Transformation Services), which also defined the version 1 of Well Known Text format (WKT 1). This method is used for WKT 1 parsing.
      Parameters:
      code - the legacy vertical datum code.
      Returns:
      the vertical datum type, or null if the code is unrecognized.
    • toLegacy

      public static int toLegacy(org.opengis.referencing.datum.VerticalDatumType type)
      Returns the legacy code for the datum type, or 0 if unknown. This method is used for WKT 1 formatting.
      Parameters:
      type - the vertical datum type, or null if unknown.
      Returns:
      the legacy code for the given datum type, or 0 if unknown.
    • guess

      public static org.opengis.referencing.datum.VerticalDatumType guess(String name, Collection<? extends org.opengis.util.GenericName> aliases, org.opengis.referencing.cs.CoordinateSystemAxis axis)
      Guesses the type of a datum from its name, aliases or a given vertical axis. This is sometimes needed after XML unmarshalling or WKT parsing, since GML 3.2 and ISO 19162 do not contain any attribute for the datum type.

      This method uses heuristic rules and may be changed in any future SIS version. If the type cannot be determined, defaults to VerticalDatumType.OTHER_SURFACE.

      Parameters:
      name - the name of the datum for which to guess a type, or null if unknown.
      aliases - the aliases of the datum for which to guess a type, or null if unknown.
      axis - the vertical axis for which to guess a type, or null if unknown.
      Returns:
      a datum type, or VerticalDatumType.OTHER_SURFACE if none can be guessed.
    • guess

      private static org.opengis.referencing.datum.VerticalDatumType guess(String name)
      Guesses the type of a datum of the given name. This method attempts to guess only if the given name contains at least one letter. If the type cannot be determined, returns null.
      Parameters:
      name - name of the datum for which to guess a type, or null.
      Returns:
      a datum type, or null if none can be guessed.
    • accept

      public boolean accept(org.opengis.util.CodeList<?> code)
      Returns true if the name of the given code is the prefix of a word in the datum name. We do not test the characters following the prefix because the word may be incomplete (e.g. "geoid" versus "geoidal").

      This method is public as an implementation side-effect and should be ignored.

      Specified by:
      accept in interface org.opengis.util.CodeList.Filter
      Parameters:
      code - the code to test.
      Returns:
      true if the code matches the criterion.
    • codename

      public String codename()
      Returns null for disabling the creation of new code list elements. This method is public as an implementation side-effect and should be ignored.
      Specified by:
      codename in interface org.opengis.util.CodeList.Filter
      Returns:
      null.