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

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 uk.co.mccombe.mapping.TransverseMercator

`northernHemisphere, zone`

### Fields inherited from class uk.co.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 distances
`OSGB(Position p, Ellipsoid e, Datum d)`
Create a new OSGB object for a specific Position, Ellipsoid and Datum.

## Method Summary

Modifier and Type
Method
Description
`Datum`
`defaultDatum()`
Define the defaultDatum for this CoordinateSystem
`Ellipsoid`
`defaultEllipsoid()`
Define the default Ellipsoid for this CoordinateSystem
`double`
`e0()`
Define false easting value
`double`
`f0()`
Define the scale factor on the central meridian
`double`
`lamda0()`
Define value of central meridian (degrees)
`static OSGB`
`makePoint(String osReference, Ellipsoid e, Datum d)`
Create a new OSGB point based on a grid reference.
`double`
`n0()`
Define the false northing value
`double`
`phi0()`
Define latitude of true origin
`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 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`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### 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 point
  `d` - 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)

### OSGB

public OSGB(Position p, Ellipsoid e, Datum d)
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

public static OSGB makePoint(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 example

        try {
            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 class `CoordinateSystem`
Returns:
  Datum.OSGB_1936

### defaultEllipsoid

public Ellipsoid defaultEllipsoid()
Define the default Ellipsoid for this CoordinateSystem

Specified by:
  `defaultEllipsoid` in class `CoordinateSystem`
Returns:
  Ellipsoid.AIRY

### toString

public String toString()
Provide a String representation for this point.

Specified by:
  `toString` in class `CoordinateSystem`
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 class `TransverseMercator`
Returns:
  scale factor (0.9996012717)

### phi0

public double phi0()
Define latitude of true origin

Specified by:
  `phi0` in class `TransverseMercator`
Returns:
  Latitude (degrees) of the true origin (49.0)

### n0

public double n0()
Define the false northing value

Specified by:
  `n0` in class `TransverseMercator`
Returns:
  False Northing distance (-100km)

### e0

public double e0()
Define false easting value

Specified by:
  `e0` in class `TransverseMercator`
Returns:
  false easting value (400km)

### lamda0

public double lamda0()
Define value of central meridian (degrees)

Specified by:
  `lamda0` in class `TransverseMercator`
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 ;