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

Tags (2)

Accepted Solutions
Thirteen 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

-----------

All Replies
Thirteen 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)?

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