/** Returns the legacy code for the datum type. */ @Override final int getLegacyDatumType() { final int ordinal = type.ordinal(); if (ordinal >= 0 && ordinal < LEGACY_CODES.length) { assert type.equals(TYPES[ordinal]) : type; return LEGACY_CODES[ordinal]; } return 0; }
/** * Returns the legacy code for the datum type, or 0 if unknown. * This method is used for WKT 1 formatting. * * @param type the vertical datum type, or {@code null} if unknown. * @return the legacy code for the given datum type, or 0 if unknown. */ public static int toLegacy(final VerticalDatumType type) { if (type != null) { final int ordinal = type.ordinal(); if (ordinal >= 0 && ordinal < LEGACY_CODES.length) { return LEGACY_CODES[ordinal]; } } return 0; }
/** * Returns the legacy code for the datum type, or 0 if unknown. * This method is used for WKT 1 formatting. * * @param type the vertical datum type, or {@code null} if unknown. * @return the legacy code for the given datum type, or 0 if unknown. */ public static int toLegacy(final VerticalDatumType type) { if (type != null) { final int ordinal = type.ordinal(); if (ordinal >= 0 && ordinal < LEGACY_CODES.length) { return LEGACY_CODES[ordinal]; } } return 0; }