mccombe.mapping
Class NZMG

java.lang.Object
  extended by mccombe.mapping.CoordinateSystem
      extended by mccombe.mapping.Projection
          extended by mccombe.mapping.Orthomorphic
              extended by mccombe.mapping.NZMG

public class NZMG
extends Orthomorphic


Nested Class Summary
 
Nested classes/interfaces inherited from class mccombe.mapping.Orthomorphic
Orthomorphic.Complex
 
Field Summary
 
Fields inherited from class mccombe.mapping.CoordinateSystem
locus, ref, sph
 
Constructor Summary
NZMG(ENPair point, Ellipsoid e, Datum d)
          Create a new NZMG point for a specific pair of Eastings and Northings, Ellipsoid and Datum.
NZMG(Position p, Ellipsoid e, Datum d)
          Create a new NZMG point for a specific Position, Ellipsoid and Datum.
 
Method Summary
 Orthomorphic.Complex cfb1(int i)
           
 Orthomorphic.Complex cfb2(int i)
           
 int cfblen()
           
 double cfi(int i)
           
 int cfilen()
           
 double cfl(int i)
           
 int cfllen()
           
 Datum defaultDatum()
          Get the defaul Datum for an instance of CoordinateSystem.
 Ellipsoid defaultEllipsoid()
          The default Ellipsoid used by instances of this CoordinateSystem For example, a CoordinateSystem of type OSGB has the AirySphere as its default Ellipsoid
 double e0()
           
protected static ENPair getEN(java.lang.String gridref)
          Parse NZMG coordinates into easting and northing distances
 double gridConvergence()
          Calculate the Grid Convergence for the current location.
 double lamda0()
           
static NZMG makePoint(java.lang.String gridref, Ellipsoid e, Datum d)
          Static factory method to create an instance of NZMG from a grid reference String
 double n0()
           
 double phi0()
           
 java.lang.String toString()
          Provide a String representing the position in a correct format for the CoordinateSystem
 
Methods inherited from class mccombe.mapping.Orthomorphic
a, toEN
 
Methods inherited from class 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 Detail

NZMG

public NZMG(Position p,
            Ellipsoid e,
            Datum d)
Create a new NZMG point for a specific Position, Ellipsoid and Datum.

Parameters:
p - Position
e - Ellipsoid to use with this instance
d - Datum to use

NZMG

public NZMG(ENPair point,
            Ellipsoid e,
            Datum d)
Create a new NZMG point for a specific pair of Eastings and Northings, Ellipsoid and Datum.

Parameters:
point - ENPair containing the easting and northing values
e - Ellipsoid to use with this instance
d - Datum to use
Method Detail

makePoint

public static NZMG makePoint(java.lang.String gridref,
                             Ellipsoid e,
                             Datum d)
                      throws GridFormatException
Static factory method to create an instance of NZMG from a grid reference String

Parameters:
gridref - A grid reference of the form "157203 mE 6752091 mN " where the values are easting and northing distances in m
e - Ellipsoid to use in conversions
d - Datum to use in conversions
Returns:
A new NZMG instance
Throws:
GridFormatException - thrown in case of format error in the grid reference

getEN

protected static ENPair getEN(java.lang.String gridref)
                       throws GridFormatException
Parse NZMG coordinates into easting and northing distances

Parameters:
gridref - A pair of NZMG coordinates (e.g. "2487100.638 mE 6751049.719 mN), specified in m.
Returns:
Easting and Northing distances (m)
Throws:
GridFormatException - Invalid coordinate format results in a GridFormatException being thrown

defaultEllipsoid

public Ellipsoid defaultEllipsoid()
Description copied from class: CoordinateSystem
The default Ellipsoid used by instances of this CoordinateSystem For example, a CoordinateSystem of type OSGB has the AirySphere as its default Ellipsoid

Specified by:
defaultEllipsoid in class CoordinateSystem
Returns:
The Ellipsoid used as the deafult for this CoordinateSystem

defaultDatum

public Datum defaultDatum()
Description copied from class: CoordinateSystem
Get the defaul Datum for an instance of CoordinateSystem. For example, instances of OSGB usually use the OSGB 1936 datum.

Specified by:
defaultDatum in class CoordinateSystem
Returns:
The default Datum used by this instance of CoordinateSystem

gridConvergence

public double gridConvergence()
Calculate the Grid Convergence for the current location. Grid Convergence is defined as the angle between Grid North and True North. The value is zero on the Central Meridian. In the absence of an algebraic form for grid convergence for NZMG, this implementation reverts to basics and calculates it by making a small increment (delta) north and south of the point and calculating the change in easting and northing values.

Specified by:
gridConvergence in class Orthomorphic
Returns:
The value of Grid Convergence (radians)

toString

public java.lang.String toString()
Description copied from class: CoordinateSystem
Provide a String representing the position in a correct format for the CoordinateSystem

Specified by:
toString in class CoordinateSystem
Returns:
String

cfi

public double cfi(int i)
Specified by:
cfi in class Orthomorphic

cfl

public double cfl(int i)
Specified by:
cfl in class Orthomorphic

n0

public double n0()
Specified by:
n0 in class Orthomorphic

e0

public double e0()
Specified by:
e0 in class Orthomorphic

phi0

public double phi0()
Specified by:
phi0 in class Orthomorphic

lamda0

public double lamda0()
Specified by:
lamda0 in class Orthomorphic

cfb1

public Orthomorphic.Complex cfb1(int i)
Specified by:
cfb1 in class Orthomorphic

cfb2

public Orthomorphic.Complex cfb2(int i)
Specified by:
cfb2 in class Orthomorphic

cfilen

public int cfilen()
Specified by:
cfilen in class Orthomorphic

cfllen

public int cfllen()
Specified by:
cfllen in class Orthomorphic

cfblen

public int cfblen()
Specified by:
cfblen in class Orthomorphic