Package mil.nga.mgrs

Class MGRSUtils


  • public class MGRSUtils
    extends Object
    Military Grid Reference System utilities
    Author:
    wnewman, osbornb
    • Constructor Detail

      • MGRSUtils

        public MGRSUtils()
    • Method Detail

      • validateZoneNumber

        public static void validateZoneNumber​(int number)
        Validate the zone number
        Parameters:
        number - zone number
      • validateBandLetter

        public static void validateBandLetter​(char letter)
        Validate the band letter
        Parameters:
        letter - band letter
      • nextBandLetter

        public static char nextBandLetter​(char letter)
        Get the next band letter
        Parameters:
        letter - band letter
        Returns:
        next band letter, 'Y' (MGRSConstants.MAX_BAND_LETTER + 1) if no next bands
      • previousBandLetter

        public static char previousBandLetter​(char letter)
        Get the previous band letter
        Parameters:
        letter - band letter
        Returns:
        previous band letter, 'B' (MGRSConstants.MIN_BAND_LETTER - 1) if no previous bands
      • getLabelName

        public static String getLabelName​(int zoneNumber,
                                          char bandLetter)
        Get the label name
        Parameters:
        zoneNumber - zone number
        bandLetter - band letter
        Returns:
        name
      • getHemisphere

        public static Hemisphere getHemisphere​(char bandLetter)
        Get the hemisphere from the band letter
        Parameters:
        bandLetter - band letter
        Returns:
        hemisphere