Package mil.nga.mgrs.gzd
Class GridZones
- java.lang.Object
-
- mil.nga.mgrs.gzd.GridZones
-
public class GridZones extends Object
Grid Zones, Longitudinal Strips, and Latitude Bands- Author:
- wnewman, osbornb
-
-
Constructor Summary
Constructors Constructor Description GridZones()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static char
getBandLetter(double latitude)
Get the band letter of the latitude (degrees betweenMGRSConstants.MIN_LAT
andMGRSConstants.MAX_LAT
).static char
getBandLetter(double latitude, boolean northern)
Get the band letter of the latitude (degrees betweenMGRSConstants.MIN_LAT
andMGRSConstants.MAX_LAT
)static BandLetterRange
getBandLetterRange(double south, double north)
Get a band letter range between the southern and northern latitudes in degreesstatic BandLetterRange
getBandLetterRange(Bounds bounds)
Get a band letter range between the southern and northern boundsstatic double
getEastLongitude(int zoneNumber)
Get the east longitude in degrees of the zone numberstatic GridRange
getGridRange(Bounds bounds)
Get a grid range from the boundsstatic GridZone
getGridZone(int zoneNumber, char bandLetter)
Get the grid zone by zone number and band letterstatic GridZone
getGridZone(MGRS mgrs)
Get the grid zone by MGRSstatic LatitudeBand
getLatitudeBand(char bandLetter)
Get the latitude band by band letterstatic LongitudinalStrip
getLongitudinalStrip(int zoneNumber)
Get the longitudinal strip by zone numberstatic double
getNorthLatitude(char bandLetter)
Get the north latitude in degrees of the band letterstatic double
getSouthLatitude(char bandLetter)
Get the south latitude in degrees of the band letterstatic double
getWestLongitude(int zoneNumber)
Get the west longitude in degrees of the zone numberstatic int
getZoneNumber(double longitude)
Get the zone number of the longitude (degrees betweenMGRSConstants.MIN_LON
andMGRSConstants.MAX_LON
).static int
getZoneNumber(double longitude, boolean eastern)
Get the zone number of the longitude (degrees betweenMGRSConstants.MIN_LON
andMGRSConstants.MAX_LON
)static int
getZoneNumber(double longitude, double latitude)
Get the zone number of the longitude and latitudestatic int
getZoneNumber(Point point)
Get the zone number of the pointstatic ZoneNumberRange
getZoneNumberRange(double west, double east)
Get a zone number range between the western and eastern longitudesstatic ZoneNumberRange
getZoneNumberRange(Bounds bounds)
Get a zone number range between the western and eastern boundsstatic List<GridZone>
getZones(Bounds bounds)
Get the zones within the boundsstatic boolean
isSvalbard(int zoneNumber, char bandLetter)
Is the zone number and band letter a Svalbard GZD (31X - 37X)static boolean
isSvalbardLetter(char bandLetter)
Is the band letter a Svalbard GZD (X)static boolean
isSvalbardZone(int zoneNumber)
Is the zone number a Svalbard GZD (31 - 37)
-
-
-
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 numberbandLetter
- 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 degreeseast
- 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
- longitudelatitude
- latitude- Returns:
- zone number
-
getZoneNumber
public static int getZoneNumber(double longitude)
Get the zone number of the longitude (degrees betweenMGRSConstants.MIN_LON
andMGRSConstants.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 betweenMGRSConstants.MIN_LON
andMGRSConstants.MAX_LON
)- Parameters:
longitude
- longitude in degreeseastern
- 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 degreesnorth
- northern latitude in degrees- Returns:
- band letter range
-
getBandLetter
public static char getBandLetter(double latitude)
Get the band letter of the latitude (degrees betweenMGRSConstants.MIN_LAT
andMGRSConstants.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 betweenMGRSConstants.MIN_LAT
andMGRSConstants.MAX_LAT
)- Parameters:
latitude
- latitude in degreesnorthern
- 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 numberbandLetter
- 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
-
-