A library to convert OSGB36 Eastings and Northings into grid letter representation. It is based on the information from this Wikipedia page.
Transforms OSBG36 coordinates:
Eastings 255940 metres.
Northings 98127 metres.
To UK National Grid Reference:
SX59 (10Km)
SX5598 (1Km)
The precision can be configured down to 1 meter
Maven users, add this to your POM:
<dependency>
<groupId>ro.ghionoiu</groupId>
<artifactId>osgb36-letter-conversion</artifactId>
<version>0.1.3</version>
</dependency>
OsgbPointToReferenceConverter converter =
new OsgbPointToReferenceConverter(Reference.BOX_10km);
int eastings = 255940;
int northings = 98127;
System.out.println(converter.toGridReference(eastings, northings));
//Will output: SX59
If you encounter any problems or you have a feature request please open an issue on this project's Github.