Nine Stars

How to convert Latitude,Longitude to Military Grid Reference System (MGRS)?

Any ideas on how to use Talend DI to convert Latitude, Longitude points to the Military Grid Reference System (MGRS) designator?

 

So far I haven't seen a formula that is the universal standard.

 

Example:

Input: 40.75890,-73.98513

Output: 18T WL 85662 12488

 

Military Grid Reference System (MGRS)

http://wiki.gis.com/wiki/index.php/Military_Grid_Reference_System

 

world-mgrs-grid

1 ACCEPTED SOLUTION

Accepted Solutions
Twelve Stars

Re: How to convert Latitude,Longitude to Military Grid Reference System (MGRS)?

are You looking for this - https://www.ibm.com/developerworks/java/library/j-coordconvert/ ?

 

 

this is more  - explain Math for UTM, but many similar code

-----------
2 REPLIES
Twelve Stars

Re: How to convert Latitude,Longitude to Military Grid Reference System (MGRS)?

are You looking for this - https://www.ibm.com/developerworks/java/library/j-coordconvert/ ?

 

 

this is more  - explain Math for UTM, but many similar code

-----------
Nine Stars

Re: How to convert Latitude,Longitude to Military Grid Reference System (MGRS)?

Downloaded the CoordinateConversion.java file.

 

Created a Routine and pasted the code from the CoordinateConversion.java into the Routine.

 

Then added a tJava component with this code:

 

Double lat_ = Double.parseDouble("51.172");
Double long_ = Double.parseDouble("-1.779");

String result = "";

CoordinateConversion cs = new CoordinateConversion();

result = String.valueOf( cs.latLon2MGRUTM( lat_,long_) );

System.out.println( result );