Skip to main content
Announcements
A fresh, new look for the Data Integration & Quality forums and navigation! Read more about what's changed.
cancel
Showing results for 
Search instead for 
Did you mean: 
talendtester
Creator III

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

 

0683p000009LyYh.jpg

Labels (2)
1 Solution

Accepted Solutions
vapukov
Master II

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

View solution in original post

2 Replies
vapukov
Master II

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

talendtester
Creator III
Author

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 );