Class OsGridRef


  • public class OsGridRef
    extends Object
    An Ordance Survey Grid Reference. Create create from full six-digit easting/northing values or can parse from a grid reference. Supports conversion to/from lat/lon in web standard WGS84 as well as in OSGB36.
    Author:
    Dave Reynolds
    • Constructor Detail

      • OsGridRef

        public OsGridRef​(long easting,
                         long northing)
      • OsGridRef

        public OsGridRef​(double easting,
                         double northing)
    • Method Detail

      • getEasting

        public long getEasting()
      • getNorthing

        public long getNorthing()
      • parse

        public static OsGridRef parse​(String gridref)
        Parse grid reference to easting/northing form
      • format

        public String format​(int digits)
        Return as a grid reference string to given total digit precision (i.e. 10 = 5 digit easting/northing = 1m resolution)
      • fromLatLon

        public static OsGridRef fromLatLon​(LatLonE point)
        Create grid reference from OSGB36 or WGS84 lat, lon
      • fromLatLonOSGB36

        public static OsGridRef fromLatLonOSGB36​(LatLonE point)
        Create grid reference from OSGB36 lat, lon
      • toLotLonOSGB36

        public LatLonE toLotLonOSGB36()
        Return as a lat lon point in OSGB36
      • toLatLon

        public LatLonE toLatLon()
        Return as a lat lon point in WGS84