Class GridZones


  • public class GridZones
    extends Object
    Grid Zones, Longitudinal Strips, and Latitude Bands
    Author:
    wnewman, osbornb
    • Constructor Detail

      • GridZones

        public GridZones()
    • Method Detail

      • getLongitudinalStrip

        public static LongitudinalStrip getLongitudinalStrip​(int zoneNumber)
        Get the longitudinal strip by zone number
        Parameters:
        zoneNumber - zone number
        Returns:
        longitudinal strip
      • getWestLongitude

        public static double getWestLongitude​(int zoneNumber)
        Get the west longitude in degrees of the zone number
        Parameters:
        zoneNumber - zone number
        Returns:
        longitude in degrees
      • getEastLongitude

        public static double getEastLongitude​(int zoneNumber)
        Get the east longitude in degrees of the zone number
        Parameters:
        zoneNumber - zone number
        Returns:
        longitude in degrees
      • getLatitudeBand

        public static LatitudeBand getLatitudeBand​(char bandLetter)
        Get the latitude band by band letter
        Parameters:
        bandLetter - band letter
        Returns:
        latitude band
      • getSouthLatitude

        public static double getSouthLatitude​(char bandLetter)
        Get the south latitude in degrees of the band letter
        Parameters:
        bandLetter - band letter
        Returns:
        latitude in degrees
      • getNorthLatitude

        public static double getNorthLatitude​(char bandLetter)
        Get the north latitude in degrees of the band letter
        Parameters:
        bandLetter - band letter
        Returns:
        latitude in degrees
      • getZones

        public static List<GridZone> getZones​(Bounds bounds)
        Get the zones within the bounds
        Parameters:
        bounds - bounds
        Returns:
        grid zones
      • getGridZone

        public static GridZone getGridZone​(int zoneNumber,
                                           char bandLetter)
        Get the grid zone by zone number and band letter
        Parameters:
        zoneNumber - zone number
        bandLetter - band letter
        Returns:
        grid zone
      • getGridZone

        public static GridZone getGridZone​(MGRS mgrs)
        Get the grid zone by MGRS
        Parameters:
        mgrs - mgrs coordinate
        Returns:
        grid zone
      • getGridRange

        public static GridRange getGridRange​(Bounds bounds)
        Get a grid range from the bounds
        Parameters:
        bounds - bounds
        Returns:
        grid range
      • getZoneNumberRange

        public static ZoneNumberRange getZoneNumberRange​(Bounds bounds)
        Get a zone number range between the western and eastern bounds
        Parameters:
        bounds - bounds
        Returns:
        zone number range
      • getZoneNumberRange

        public static ZoneNumberRange getZoneNumberRange​(double west,
                                                         double east)
        Get a zone number range between the western and eastern longitudes
        Parameters:
        west - western longitude in degrees
        east - eastern longitude in degrees
        Returns:
        zone number range
      • getZoneNumber

        public static int getZoneNumber​(Point point)
        Get the zone number of the point
        Parameters:
        point - point
        Returns:
        zone number
      • getZoneNumber

        public static int getZoneNumber​(double longitude,
                                        double latitude)
        Get the zone number of the longitude and latitude
        Parameters:
        longitude - longitude
        latitude - latitude
        Returns:
        zone number
      • getZoneNumber

        public static int getZoneNumber​(double longitude)
        Get the zone number of the longitude (degrees between MGRSConstants.MIN_LON and MGRSConstants.MAX_LON). Eastern zone number on borders.
        Parameters:
        longitude - longitude in degrees
        Returns:
        zone number
      • getZoneNumber

        public static int getZoneNumber​(double longitude,
                                        boolean eastern)
        Get the zone number of the longitude (degrees between MGRSConstants.MIN_LON and MGRSConstants.MAX_LON)
        Parameters:
        longitude - longitude in degrees
        eastern - true for eastern number on edges, false for western
        Returns:
        zone number
      • getBandLetterRange

        public static BandLetterRange getBandLetterRange​(Bounds bounds)
        Get a band letter range between the southern and northern bounds
        Parameters:
        bounds - bounds
        Returns:
        band letter range
      • getBandLetterRange

        public static BandLetterRange getBandLetterRange​(double south,
                                                         double north)
        Get a band letter range between the southern and northern latitudes in degrees
        Parameters:
        south - southern latitude in degrees
        north - northern latitude in degrees
        Returns:
        band letter range
      • getBandLetter

        public static char getBandLetter​(double latitude)
        Get the band letter of the latitude (degrees between MGRSConstants.MIN_LAT and MGRSConstants.MAX_LAT). Northern band letter on borders.
        Parameters:
        latitude - latitude in degrees
        Returns:
        band letter
      • getBandLetter

        public static char getBandLetter​(double latitude,
                                         boolean northern)
        Get the band letter of the latitude (degrees between MGRSConstants.MIN_LAT and MGRSConstants.MAX_LAT)
        Parameters:
        latitude - latitude in degrees
        northern - true for northern band on edges, false for southern
        Returns:
        band letter
      • isSvalbard

        public static boolean isSvalbard​(int zoneNumber,
                                         char bandLetter)
        Is the zone number and band letter a Svalbard GZD (31X - 37X)
        Parameters:
        zoneNumber - zone number
        bandLetter - band letter
        Returns:
        true if a Svalbard GZD
      • isSvalbardLetter

        public static boolean isSvalbardLetter​(char bandLetter)
        Is the band letter a Svalbard GZD (X)
        Parameters:
        bandLetter - band letter
        Returns:
        true if a Svalbard GZD
      • isSvalbardZone

        public static boolean isSvalbardZone​(int zoneNumber)
        Is the zone number a Svalbard GZD (31 - 37)
        Parameters:
        zoneNumber - zone number
        Returns:
        true if a Svalbard GZD