Package com.epimorphics.geo
Class OsGridRef
- java.lang.Object
-
- com.epimorphics.geo.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
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringformat(int digits)Return as a grid reference string to given total digit precision (i.e.static OsGridReffromLatLon(LatLonE point)Create grid reference from OSGB36 or WGS84 lat, lonstatic OsGridReffromLatLonOSGB36(LatLonE point)Create grid reference from OSGB36 lat, lonlonggetEasting()longgetNorthing()static OsGridRefparse(String gridref)Parse grid reference to easting/northing formLatLonEtoLatLon()Return as a lat lon point in WGS84LatLonEtoLotLonOSGB36()Return as a lat lon point in OSGB36
-
-
-
Method Detail
-
getEasting
public long getEasting()
-
getNorthing
public long getNorthing()
-
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
-
-