Package uk.co.mccombe.mapping
Class OSGB
java.lang.Object
uk.co.mccombe.mapping.CoordinateSystem
uk.co.mccombe.mapping.Projection
uk.co.mccombe.mapping.TransverseMercator
uk.co.mccombe.mapping.OSGB
Class OSGB provides handling for the Ordnance Survey of Great Britain coordinate system.
OSGB is a conventional Transverse Mercator coordinate system in which a standard sphere (the "Airy 1830 sphere") is projected onto a plane. Several other well-known coordinate systems operate in the same way (e.g. the Irish Grid and UTM) but with origins and spheroids chosen to be most suitable to the area of use. The OSGB grid is applicable only to Great Britain (i.e. England, Scotland and Wales but NOT Northern Ireland or the Republic of Ireland, or the Channel Islands).
For more information about OSGB and the manipulation of Transverse Mercator coordinate systems you could try:-
"A guide to coordinate systems in Great Britain" - Ordnance Survey of Great Britain "GDA Technical Manual" at www.anzlic.org.au
-
Field Summary
Fields inherited from class uk.co.mccombe.mapping.TransverseMercator
northernHemisphere, zone
Fields inherited from class uk.co.mccombe.mapping.CoordinateSystem
locus, ref, sph
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new OSGB object using Easting and Northing distances.Create a new OSGB object from easting and northing distancesCreate a new OSGB object for a specific Position, Ellipsoid and Datum. -
Method Summary
Modifier and TypeMethodDescriptionDefine the defaultDatum for this CoordinateSystemDefine the default Ellipsoid for this CoordinateSystemdouble
e0()
Define false easting valuedouble
f0()
Define the scale factor on the central meridiandouble
lamda0()
Define value of central meridian (degrees)static OSGB
Create a new OSGB point based on a grid reference.double
n0()
Define the false northing valuedouble
phi0()
Define latitude of true origintoString()
Provide a String representation for this point.protected static boolean
validateEN
(ENPair p) Check that ENPair lies within the permitted rangeMethods inherited from class uk.co.mccombe.mapping.TransverseMercator
gridConvergence, pointScaleFactor, toEN
Methods inherited from class uk.co.mccombe.mapping.CoordinateSystem
getDatum, getEllipsoid, getName, getPosition, getWGS84, parseDouble, toLatLong, toLatLongString
-
Constructor Details
-
OSGB
Create a new OSGB object from easting and northing distances- Parameters:
p
- Easting and Northing distances (m)e
- Ellipsoid used by this pointd
- Datum used for this point.
-
OSGB
Create a new OSGB object using Easting and Northing distances. The Ellispoid and Datum are the Airy Sphere and OSGB (1936) Datum.- Parameters:
p
- The easting and northing distances (m)
-
OSGB
Create a new OSGB object for a specific Position, Ellipsoid and Datum.- Parameters:
p
- the Position of this point.e
- The Ellipsoid to use (normally Ellipsoid.AIRY)d
- The Datum to use (normally Datum.OSGB_1936)
-
-
Method Details
-
makePoint
Create a new OSGB point based on a grid reference. This is the preferred method of obtaining a new OSGB object from a grid reference and for translating a grid reference into a Position. For exampletry { OSGB point = OSGB.makePoint("ST755619", Ellipsoid.AIRY, Datum.OSGB_1936); Position here = point.getPosition(); ... } catch(GridFormatException e){ //Handle exception ... }
- Parameters:
osReference
- A String containg a valid grid reference. This consists of a two-letter grid square (e.g. "ST") followed by 1-5 digits of easting and the same number of digits of northing. Whitespace may appear between the grid-letters and easting and between easting and northing values.e
- The Ellipsoid used in conjunction with this point. This is almost always the Airy (1830) sphere.d
- The Datum to use in conjunction with this point. This is almost always the OSGB (1936) Datum.- Returns:
- A new OSGB object
- Throws:
GridFormatException
- A GridFormatException is thrown whenever the grid reference provided has invalid syntax.
-
defaultDatum
Define the defaultDatum for this CoordinateSystem- Specified by:
defaultDatum
in classCoordinateSystem
- Returns:
- Datum.OSGB_1936
-
defaultEllipsoid
Define the default Ellipsoid for this CoordinateSystem- Specified by:
defaultEllipsoid
in classCoordinateSystem
- Returns:
- Ellipsoid.AIRY
-
toString
Provide a String representation for this point.- Specified by:
toString
in classCoordinateSystem
- Returns:
- 10-figure (1m) grid reference, with grid square
-
f0
public double f0()Define the scale factor on the central meridian- Specified by:
f0
in classTransverseMercator
- Returns:
- scale factor (0.9996012717)
-
phi0
public double phi0()Define latitude of true origin- Specified by:
phi0
in classTransverseMercator
- Returns:
- Latitude (degrees) of the true origin (49.0)
-
n0
public double n0()Define the false northing value- Specified by:
n0
in classTransverseMercator
- Returns:
- False Northing distance (-100km)
-
e0
public double e0()Define false easting value- Specified by:
e0
in classTransverseMercator
- Returns:
- false easting value (400km)
-
lamda0
public double lamda0()Define value of central meridian (degrees)- Specified by:
lamda0
in classTransverseMercator
- Returns:
- central meridian (2.0 W)
-
validateEN
Check that ENPair lies within the permitted range- Parameters:
p
-- Returns:
- true if OK ;
-