/** * Returns the VerticalDatumType that matches the given string, or returns a * new one if none match it. */ public static VerticalDatumType valueOf(String code) { if (code == null) { return null; } synchronized (VALUES) { Iterator iter = VALUES.iterator(); while (iter.hasNext()) { VerticalDatumType type = (VerticalDatumType) iter.next(); if (code.equalsIgnoreCase(type.name())) { return type; } } return new VerticalDatumType(code); } } }
/** * Returns {@code true} if the type of the given datum is ellipsoidal. A vertical datum is not allowed * to be ellipsoidal according ISO 19111, but Apache SIS relaxes this restriction in some limited cases, * for example when parsing a string in the legacy WKT 1 format. Apache SIS should not expose those * vertical heights as much as possible, and instead try to combine them with three-dimensional * geographic or projected CRS as soon as it can. * * @param datum the datum to test, or {@code null} if none. * @return {@code true} if the given datum is non null and of ellipsoidal type. * * @see org.apache.sis.internal.metadata.VerticalDatumTypes#ELLIPSOIDAL * * @since 0.8 */ public static boolean isEllipsoidalHeight(final VerticalDatum datum) { if (datum != null) { final VerticalDatumType type = datum.getVerticalDatumType(); if (type != null) { return "ELLIPSOIDAL".equalsIgnoreCase(type.name()); } } return false; }
/** * Returns {@code true} if the type of the given datum is ellipsoidal. A vertical datum is not allowed * to be ellipsoidal according ISO 19111, but Apache SIS relaxes this restriction in some limited cases, * for example when parsing a string in the legacy WKT 1 format. Apache SIS should not expose those * vertical heights as much as possible, and instead try to combine them with three-dimensional * geographic or projected CRS as soon as it can. * * @param datum the datum to test, or {@code null} if none. * @return {@code true} if the given datum is non null and of ellipsoidal type. * * @see org.apache.sis.internal.metadata.VerticalDatumTypes#ELLIPSOIDAL * * @since 0.8 */ public static boolean isEllipsoidalHeight(final VerticalDatum datum) { if (datum != null) { final VerticalDatumType type = datum.getVerticalDatumType(); if (type != null) { return "ELLIPSOIDAL".equalsIgnoreCase(type.name()); } } return false; }