Package mccombe.mapping
Class OSGB
- java.lang.Object
-
- mccombe.mapping.CoordinateSystem
-
- mccombe.mapping.Projection
-
- mccombe.mapping.TransverseMercator
-
- mccombe.mapping.OSGB
-
public class OSGB extends TransverseMercator
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 mccombe.mapping.TransverseMercator
northernHemisphere, zone
-
Fields inherited from class mccombe.mapping.CoordinateSystem
locus, ref, sph
-
-
Constructor Summary
Constructors Constructor Description OSGB(ENPair p)
Create a new OSGB object using Easting and Northing distances.OSGB(ENPair p, Ellipsoid e, Datum d)
Create a new OSGB object from easting and northing distancesOSGB(Position p, Ellipsoid e, Datum d)
Create a new OSGB object for a specific Position, Ellipsoid and Datum.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Datum
defaultDatum()
Define the defaultDatum for this CoordinateSystemEllipsoid
defaultEllipsoid()
Define 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
makePoint(java.lang.String osReference, Ellipsoid e, Datum d)
Create a new OSGB point based on a grid reference.double
n0()
Define the false northing valuedouble
phi0()
Define latitude of true originjava.lang.String
toString()
Provide a String representation for this point.protected static boolean
validateEN(ENPair p)
Check that ENPair lies within the permitted range-
Methods inherited from class mccombe.mapping.TransverseMercator
gridConvergence, pointScaleFactor, toEN
-
Methods inherited from class mccombe.mapping.CoordinateSystem
getDatum, getEllipsoid, getName, getPosition, getWGS84, parseDouble, toLatLong, toLatLongString
-
-
-
-
Constructor Detail
-
OSGB
public OSGB(ENPair p, Ellipsoid e, Datum d)
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
public OSGB(ENPair p)
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)
-
-
Method Detail
-
makePoint
public static OSGB makePoint(java.lang.String osReference, Ellipsoid e, Datum d) throws GridFormatException
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
public Datum defaultDatum()
Define the defaultDatum for this CoordinateSystem- Specified by:
defaultDatum
in classCoordinateSystem
- Returns:
- Datum.OSGB_1936
-
defaultEllipsoid
public Ellipsoid defaultEllipsoid()
Define the default Ellipsoid for this CoordinateSystem- Specified by:
defaultEllipsoid
in classCoordinateSystem
- Returns:
- Ellipsoid.AIRY
-
toString
public java.lang.String 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
protected static boolean validateEN(ENPair p)
Check that ENPair lies within the permitted range- Parameters:
p
-- Returns:
- true if OK ;
-
-