|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bbn.openmap.proj.coords.UTMPoint com.bbn.openmap.proj.coords.ZonedUTMPoint com.bbn.openmap.proj.coords.MGRSPoint
public class MGRSPoint
A class representing a MGRS coordinate that has the ability to provide the decimal degree lat/lon equivalent, as well as the UTM equivalent. This class does not do checks to see if the MGRS coordinates provided actually make sense. It assumes that the values are valid.
Field Summary | |
---|---|
static int |
A
|
protected int |
accuracy
Controls the number of digits that the MGRS coordinate will have, which directly affects the accuracy of the coordinate. |
static int |
ACCURACY_1_METER
Use 5 digits for northing and easting values, for 1 meter accuracy of coordinate. |
static int |
ACCURACY_10_METER
Use 4 digits for northing and easting values, for 10 meter accuracy of coordinate. |
static int |
ACCURACY_100_METER
Use 3 digits for northing and easting values, for 100 meter accuracy of coordinate. |
static int |
ACCURACY_1000_METER
Use 2 digits for northing and easting values, for 1000 meter accuracy of coordinate. |
static int |
ACCURACY_10000_METER
Use 1 digits for northing and easting values, for 10000 meter accuracy of coordinate. |
static int[] |
BESSEL_SET_ORIGIN_COLUMN_LETTERS
The column letters (for easting) of the lower left value, per set,, for Bessel Ellipsoid. |
static int[] |
BESSEL_SET_ORIGIN_ROW_LETTERS
The row letters (for northing) of the lower left value, per set, for Bessel Ellipsoid. |
protected boolean |
DEBUG
|
static int |
I
|
protected static java.util.logging.Logger |
logger
|
protected java.lang.String |
mgrs
The String holding the MGRS coordinate value. |
protected static int |
NUM_100K_SETS
UTM zones are grouped, and assigned to one of a group of 6 sets. |
static int |
O
|
protected int[] |
originColumnLetters
The set origin column letters to use. |
protected int[] |
originRowLetters
The set origin row letters to use. |
static int |
SET_NORTHING_ROLLOVER
|
static int[] |
SET_ORIGIN_COLUMN_LETTERS
The column letters (for easting) of the lower left value, per set. |
static int[] |
SET_ORIGIN_ROW_LETTERS
The row letters (for northing) of the lower left value, per set. |
static int |
V
|
static int |
Z
|
Fields inherited from class com.bbn.openmap.proj.coords.UTMPoint |
---|
easting, northing, zone_letter, zone_number |
Constructor Summary | |
---|---|
MGRSPoint()
Point to create if you are going to use the static methods to fill the values in. |
|
MGRSPoint(double northing,
double easting,
int zoneNumber,
char zoneLetter)
Create a MGRSPoint from standard values. |
|
MGRSPoint(LatLonPoint llpoint)
Construct a MGRSPoint from a LatLonPoint, assuming a WGS_84 ellipsoid. |
|
MGRSPoint(LatLonPoint llpoint,
Ellipsoid ellip)
Construct a MGRSPoint from a LatLonPoint and a particular ellipsoid. |
|
MGRSPoint(MGRSPoint point)
Constructs a new MGRSPoint instance from values in another MGRSPoint. |
|
MGRSPoint(java.lang.String mgrsString)
Constructs a new MGRS instance from a MGRS String, validating the string as a MGRS coordinate. |
Method Summary | |
---|---|
protected char |
checkZone(char zone)
Method that provides a check for MGRS zone letters. |
protected void |
decode(java.lang.String mgrsString)
Set the MGRS parameters from a MGRS coordinate string. |
protected java.lang.String |
get100kID(double easting,
double northing,
int zone_number)
Get the two letter 100k designator for a given MGRS/UTM easting, northing and zone number value. |
protected java.lang.String |
get100kID(int setColumn,
int setRow,
int set)
Get the two-letter MGRS 100k designator given information translated from the MGRS/UTM northing, easting and zone number. |
protected int |
get100kSetForZone(int i)
Given a MGRS/UTM zone number, figure out the MGRS 100K set it is in. |
int |
getAccuracy()
|
protected float |
getEastingFromChar(char e,
int set)
Given the first letter from a two-letter MGRS 100k zone, and given the MGRS table set for the zone number, figure out the easting value that should be added to the other, secondary easting value. |
java.lang.String |
getMGRS()
Get the MGRS string value - the honkin' coordinate value. |
protected float |
getMinNorthing(char zoneLetter)
The function getMinNorthing returns the minimum northing value of a MGRS zone. |
protected float |
getNorthingFromChar(char n,
int set)
Given the second letter from a two-letter MGRS 100k zone, and given the MGRS table set for the zone number, figure out the northing value that should be added to the other, secondary northing value. |
protected int[] |
getOriginColumnLetters()
Provided so that extensions to this class can provide different origin letters, in case of different ellipsoids. |
protected int[] |
getOriginRowLetters()
Provided so that extensions to this class can provide different origin letters, in case of different ellipsoids. |
static MGRSPoint |
LLtoMGRS(LatLonPoint llpoint)
Converts a LatLonPoint to a MGRS Point, assuming the WGS_84 ellipsoid. |
static MGRSPoint |
LLtoMGRS(LatLonPoint llp,
Ellipsoid ellip,
MGRSPoint mgrsp)
Create a MGRSPoint from a LatLonPoint. |
static MGRSPoint |
LLtoMGRS(LatLonPoint llpoint,
MGRSPoint mgrsp)
Converts a LatLonPoint to a MGRS Point. |
static void |
main(java.lang.String[] argv)
|
static LatLonPoint |
MGRStoLL(Ellipsoid ellip,
double northing,
double easting,
int zoneNumber,
char zoneLetter,
LatLonPoint llp)
Create a LatLonPoint from a MGRSPoint. |
static LatLonPoint |
MGRStoLL(MGRSPoint mgrsp,
Ellipsoid ellip,
LatLonPoint llp)
Create a LatLonPoint from a MGRSPoint. |
static char |
MGRSZoneToUTMZone(char mgrsZone)
Convert MGRS zone letter to UTM zone letter, N or S. |
protected void |
print100kSets()
Testing method, used to print out the MGRS 100k two letter set tables. |
void |
resolve()
Create the mgrs string based on the internal MGRS parameter settings, using the accuracy set in the MGRSPoint. |
void |
resolve(int digitAccuracy)
Create the mgrs string based on the internal MGRS parameter settings, should be called if the accuracy changes. |
void |
setAccuracy(int value)
Set the number of digits to use for easting and northing numbers in the mgrs string, which reflects the accuracy of the coordinate. |
void |
setMGRS(java.lang.String mgrsString)
Set the MGRS value for this Point. |
protected void |
setOriginColumnLetters(int[] letters)
Provided so that extensions to this class can provide different origin letters, in case of different ellipsoids. |
protected void |
setOriginRowLetters(int[] letters)
Provided so that extensions to this class can provide different origin letters, in case of different ellipsoids. |
LatLonPoint |
toLatLonPoint()
Convert this MGRSPoint to a LatLonPoint, and assume a WGS_84 ellipsoid. |
LatLonPoint |
toLatLonPoint(Ellipsoid ellip)
Convert this MGRSPoint to a LatLonPoint, and use the given ellipsoid. |
LatLonPoint |
toLatLonPoint(Ellipsoid ellip,
LatLonPoint llpoint)
Fill in the given LatLonPoint with the converted values of this MGRSPoint, and use the given ellipsoid. |
java.lang.String |
toString()
Returns a string representation of the object. |
Methods inherited from class com.bbn.openmap.proj.coords.ZonedUTMPoint |
---|
getLetterDesignator, ZonedUTMtoLL |
Methods inherited from class com.bbn.openmap.proj.coords.UTMPoint |
---|
equals, getZoneNumber, hashCode, LLtoUTM, LLtoUTM, LLtoUTM, LLtoUTM, UTMtoLL, UTMtoLL, UTMtoLL, UTMtoLL |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final int NUM_100K_SETS
public static final int[] SET_ORIGIN_COLUMN_LETTERS
public static final int[] SET_ORIGIN_ROW_LETTERS
public static final int[] BESSEL_SET_ORIGIN_COLUMN_LETTERS
public static final int[] BESSEL_SET_ORIGIN_ROW_LETTERS
public static final int SET_NORTHING_ROLLOVER
public static final int ACCURACY_1_METER
public static final int ACCURACY_10_METER
public static final int ACCURACY_100_METER
public static final int ACCURACY_1000_METER
public static final int ACCURACY_10000_METER
protected int[] originColumnLetters
protected int[] originRowLetters
public static final int A
public static final int I
public static final int O
public static final int V
public static final int Z
protected boolean DEBUG
protected static final java.util.logging.Logger logger
protected java.lang.String mgrs
protected int accuracy
Constructor Detail |
---|
public MGRSPoint()
public MGRSPoint(java.lang.String mgrsString) throws java.lang.NumberFormatException
java.lang.NumberFormatException
public MGRSPoint(MGRSPoint point)
public MGRSPoint(double northing, double easting, int zoneNumber, char zoneLetter)
northing
- northing offseteasting
- easting offsetzoneNumber
- the MGRS zone numberzoneLetter
- the MGRS zone letter.public MGRSPoint(LatLonPoint llpoint)
public MGRSPoint(LatLonPoint llpoint, Ellipsoid ellip)
Method Detail |
---|
public void setMGRS(java.lang.String mgrsString) throws java.lang.NumberFormatException
java.lang.NumberFormatException
public java.lang.String getMGRS()
public LatLonPoint toLatLonPoint()
toLatLonPoint
in class UTMPoint
public LatLonPoint toLatLonPoint(Ellipsoid ellip)
toLatLonPoint
in class UTMPoint
public LatLonPoint toLatLonPoint(Ellipsoid ellip, LatLonPoint llpoint)
toLatLonPoint
in class UTMPoint
public java.lang.String toString()
toString
in class UTMPoint
public static LatLonPoint MGRStoLL(MGRSPoint mgrsp, Ellipsoid ellip, LatLonPoint llp)
mgrsp
- to convert.ellip
- Ellipsoid for earth model.llp
- a LatLonPoint to fill in values for. If null, a new LatLonPoint
will be returned. If not null, the new values will be set in this
object, and it will be returned.
public static LatLonPoint MGRStoLL(Ellipsoid ellip, double northing, double easting, int zoneNumber, char zoneLetter, LatLonPoint llp)
ellip
- ellipsoidnorthing
- northing in meterseasting
- easting in meterszoneNumber
- zone number for mgrszoneLetter
- zone letter for mgrsllp
- LatLonPoint object to use for answer, ok if null.
public static MGRSPoint LLtoMGRS(LatLonPoint llpoint)
public static MGRSPoint LLtoMGRS(LatLonPoint llpoint, MGRSPoint mgrsp)
llpoint
- the LatLonPoint to convert.mgrsp
- a MGRSPoint to put the results in. If it's null, a MGRSPoint
will be allocated.
public static MGRSPoint LLtoMGRS(LatLonPoint llp, Ellipsoid ellip, MGRSPoint mgrsp)
llp
- LatLonPoint to convert.ellip
- Ellipsoid for earth model.mgrsp
- a MGRSPoint to fill in values for. If null, a new MGRSPoint
will be returned. If not null, the new values will be set in this
object, and it will be returned.
public static char MGRSZoneToUTMZone(char mgrsZone)
mgrsZone
-
protected char checkZone(char zone)
checkZone
in class UTMPoint
public void setAccuracy(int value)
public int getAccuracy()
protected void decode(java.lang.String mgrsString) throws java.lang.NumberFormatException
mgrsString
- an UPPERCASE coordinate string is expected.
java.lang.NumberFormatException
public void resolve(int digitAccuracy)
digitAccuracy
- The number of digits to use for the northing and
easting numbers. 5 digits reflect a 1 meter accuracy, 4 - 10 meter,
3 - 100 meter, 2 - 1000 meter, 1 - 10,000 meter.public void resolve()
protected int get100kSetForZone(int i)
protected int[] getOriginColumnLetters()
protected void setOriginColumnLetters(int[] letters)
protected int[] getOriginRowLetters()
protected void setOriginRowLetters(int[] letters)
protected java.lang.String get100kID(double easting, double northing, int zone_number)
protected float getEastingFromChar(char e, int set)
protected float getNorthingFromChar(char n, int set)
n
- second letter of the MGRS 100k zoneset
- the MGRS table set number, which is dependent on the MGRS/UTM zone
number.protected java.lang.String get100kID(int setColumn, int setRow, int set)
setColumn
- the column index as it relates to the MGRS 100k set
spreadsheet, created from the MGRS/UTM easting. Values are 1-8.setRow
- the row index as it relates to the MGRS 100k set
spreadsheet, created from the MGRS/UTM northing value. Values are from
0-19.set
- the set block, as it relates to the MGRS 100k set spreadsheet,
created from the MGRS/UTM zone. Values are from 1-60.
protected void print100kSets()
protected float getMinNorthing(char zoneLetter) throws java.lang.NumberFormatException
java.lang.NumberFormatException
public static void main(java.lang.String[] argv)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |