private Unit<?> getFirstAxisUnit(CoordinateSystem coordinateSystem) { if (coordinateSystem == null || coordinateSystem.getDimension() > 0) { return null; } return coordinateSystem.getAxis(0).getUnit(); }
/** * Applies heuristic rules in order to determine if the two first axis should be interchanged. */ private static boolean swapXY(final CoordinateSystem cs) { if (cs != null && cs.getDimension() >= 2) { return AxisDirection.NORTH.equals(cs.getAxis(0).getDirection().absolute()) && AxisDirection.EAST.equals(cs.getAxis(1).getDirection().absolute()); } return false; }
/** * Returns the rank for the specified axis. Any axis that were not specified at construction * time will ordered after all known axis. */ private final int rank(final CoordinateSystemAxis axis) { int c = axis.getDirection().absolute().ordinal(); c = (c >= 0 && c < directionRanks.length) ? directionRanks[c] : directionRanks.length; return c; }
/** * Returns the axis direction for the specified coordinate system. * * @param cs The coordinate system. * @return The axis directions for the specified coordinate system. */ private static AxisDirection[] getAxisDirections(final CoordinateSystem cs) { final AxisDirection[] axis = new AxisDirection[cs.getDimension()]; for (int i = 0; i < axis.length; i++) { axis[i] = cs.getAxis(i).getDirection(); } return axis; }
writer.write("<high>" + upper + "</high>\n"); final CoordinateSystem cs = crs.getCoordinateSystem(); for (int i = 0; i < cs.getDimension(); i++) { writer.write("<axisName>" + cs.getAxis(i).getName().getCode() + "</axisName>\n");
/** * Returns {@code true} if the specified axis is oriented toward the specified direction and * uses decimal degrees units. */ private static boolean isStandard( final CoordinateSystemAxis axis, final AxisDirection direction) { return direction.equals(axis.getDirection()) && NonSI.DEGREE_ANGLE.equals(axis.getUnit()); }
/** * Returns {@code true} if the specified axis direction is allowed for this coordinate system. * The default implementation accepts only temporal directions (i.e. {@link AxisDirection#FUTURE * FUTURE} and {@link AxisDirection#PAST PAST}). */ @Override protected boolean isCompatibleDirection(final AxisDirection direction) { return AxisDirection.FUTURE.equals(direction.absolute()); }
/** * Returns the axis for the underlying {@linkplain CoordinateSystem coordinate system} at the * specified dimension. This is equivalent to <code> * {@linkplain #coordinateSystem}.{@linkplain CoordinateSystem#getAxis getAxis}(dimension) * </code>. * * @param dimension The zero based index of axis. * @return The axis at the specified dimension. * @throws IndexOutOfBoundsException if {@code dimension} is out of bounds. */ public CoordinateSystemAxis getAxis(int dimension) throws IndexOutOfBoundsException { return coordinateSystem.getAxis(dimension); }
/** * Returns the dimension of the underlying {@linkplain CoordinateSystem coordinate system}. This * is equivalent to <code>{@linkplain #coordinateSystem}.{@linkplain * CoordinateSystem#getDimension getDimension}()</code>. * * @return The dimension of this coordinate reference system. */ public int getDimension() { return coordinateSystem.getDimension(); }
/** * Returns the axis direction that matches the given string, or returns a new one if none match * it. * * @param code The name of the code to fetch or to create. * @return A code matching the given name. */ public static AxisDirection valueOf(String code) { return valueOf(AxisDirection.class, code); } }
/** Returns the list of enumerations of the same kind than this enum. */ public AxisDirection[] family() { return values(); }
/** Returns the list of enumerations of the same kind than this enum. */ public RangeMeaning[] family() { return values(); }
/** * Returns the range meaning that matches the given string, or returns a new one if none match * it. * * @param code The name of the code to fetch or to create. * @return A code matching the given name. */ public static RangeMeaning valueOf(String code) { return valueOf(RangeMeaning.class, code); } }
/** * Returns {@code true} if the specified axis direction is allowed for this coordinate system. * The default implementation accepts only vertical directions (i.e. {@link AxisDirection#UP UP} * and {@link AxisDirection#DOWN DOWN}). */ @Override protected boolean isCompatibleDirection(final AxisDirection direction) { return AxisDirection.UP.equals(direction.absolute()); }
/** * Get the {@link AxisDirection} object related to the specified direction * * @param direction * @return */ static AxisDirection getDirection(final String direction) { return AxisDirection.valueOf(direction); }
/** * Returns {@code true} if the specified axis direction is allowed for this coordinate system. * The default implementation accepts all directions except temporal ones (i.e. {@link * AxisDirection#FUTURE FUTURE} and {@link AxisDirection#PAST PAST}). */ @Override protected boolean isCompatibleDirection(final AxisDirection direction) { return !AxisDirection.FUTURE.equals(direction.absolute()); }
/** * Returns {@code true} if the specified axis direction is allowed for this coordinate system. * The default implementation accepts all directions except temporal ones (i.e. {@link * AxisDirection#FUTURE FUTURE} and {@link AxisDirection#PAST PAST}). */ @Override protected boolean isCompatibleDirection(final AxisDirection direction) { return !AxisDirection.FUTURE.equals(direction.absolute()); } }
/** * Returns {@code true} if the specified axis direction is allowed for this coordinate system. * The default implementation accepts all directions except temporal ones (i.e. {@link * AxisDirection#FUTURE FUTURE} and {@link AxisDirection#PAST PAST}). */ @Override protected boolean isCompatibleDirection(final AxisDirection direction) { return !AxisDirection.FUTURE.equals(direction.absolute()); } }
/** * Returns {@code true} if the specified axis direction is allowed for this coordinate system. * The default implementation accepts all directions except temporal ones (i.e. {@link * AxisDirection#FUTURE FUTURE} and {@link AxisDirection#PAST PAST}). */ @Override protected boolean isCompatibleDirection(final AxisDirection direction) { return !AxisDirection.FUTURE.equals(direction.absolute()); } }
/** * Returns {@code true} if the specified axis direction is allowed for this coordinate system. * The default implementation accepts only the following directions: {@link AxisDirection#NORTH * NORTH}, {@link AxisDirection#SOUTH SOUTH}, {@link AxisDirection#EAST EAST}, {@link * AxisDirection#WEST WEST}, {@link AxisDirection#UP UP} and {@link AxisDirection#DOWN DOWN}. */ @Override protected boolean isCompatibleDirection(AxisDirection direction) { direction = direction.absolute(); return AxisDirection.NORTH.equals(direction) || AxisDirection.EAST.equals(direction) || AxisDirection.UP.equals(direction); }