Class 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
     

    • 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 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 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 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
      • toString

        public java.lang.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 ;