Package uk.co.mccombe.mapping
Class NZMG
java.lang.Object
uk.co.mccombe.mapping.CoordinateSystem
uk.co.mccombe.mapping.Projection
uk.co.mccombe.mapping.Orthomorphic
uk.co.mccombe.mapping.NZMG
-
Nested Class Summary
Nested classes/interfaces inherited from class uk.co.mccombe.mapping.Orthomorphic
Orthomorphic.Complex -
Field Summary
Fields inherited from class uk.co.mccombe.mapping.CoordinateSystem
locus, ref, sph -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncfb1(int i) cfb2(int i) intcfblen()doublecfi(int i) intcfilen()doublecfl(int i) intcfllen()Get the defaul Datum for an instance of CoordinateSystem.The default Ellipsoid used by instances of this CoordinateSystem For example, a CoordinateSystem of type OSGB has the AirySphere as its default Ellipsoiddoublee0()protected static ENPairParse NZMG coordinates into easting and northing distancesdoubleCalculate the Grid Convergence for the current location.doublelamda0()static NZMGStatic factory method to create an instance of NZMG from a grid reference Stringdoublen0()doublephi0()toString()Provide a String representing the position in a correct format for the CoordinateSystemMethods inherited from class uk.co.mccombe.mapping.Orthomorphic
a, toENMethods inherited from class uk.co.mccombe.mapping.CoordinateSystem
getDatum, getEllipsoid, getName, getPosition, getWGS84, parseDouble, toLatLong, toLatLongString
-
Constructor Details
-
NZMG
Create a new NZMG point for a specific Position, Ellipsoid and Datum.- Parameters:
p- Positione- Ellipsoid to use with this instanced- Datum to use
-
NZMG
Create a new NZMG point for a specific pair of Eastings and Northings, Ellipsoid and Datum.- Parameters:
point- ENPair containing the easting and northing valuese- Ellipsoid to use with this instanced- Datum to use
-
-
Method Details
-
makePoint
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 me- Ellipsoid to use in conversionsd- Datum to use in conversions- Returns:
- A new NZMG instance
- Throws:
GridFormatException- thrown in case of format error in the grid reference
-
getEN
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
Description copied from class:CoordinateSystemThe default Ellipsoid used by instances of this CoordinateSystem For example, a CoordinateSystem of type OSGB has the AirySphere as its default Ellipsoid- Specified by:
defaultEllipsoidin classCoordinateSystem- Returns:
- The Ellipsoid used as the deafult for this CoordinateSystem
-
defaultDatum
Description copied from class:CoordinateSystemGet the defaul Datum for an instance of CoordinateSystem. For example, instances of OSGB usually use the OSGB 1936 datum.- Specified by:
defaultDatumin classCoordinateSystem- 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:
gridConvergencein classOrthomorphic- Returns:
- The value of Grid Convergence (radians)
-
toString
Description copied from class:CoordinateSystemProvide a String representing the position in a correct format for the CoordinateSystem- Specified by:
toStringin classCoordinateSystem- Returns:
- String
-
cfi
public double cfi(int i) - Specified by:
cfiin classOrthomorphic
-
cfl
public double cfl(int i) - Specified by:
cflin classOrthomorphic
-
n0
public double n0()- Specified by:
n0in classOrthomorphic
-
e0
public double e0()- Specified by:
e0in classOrthomorphic
-
phi0
public double phi0()- Specified by:
phi0in classOrthomorphic
-
lamda0
public double lamda0()- Specified by:
lamda0in classOrthomorphic
-
cfb1
- Specified by:
cfb1in classOrthomorphic
-
cfb2
- Specified by:
cfb2in classOrthomorphic
-
cfilen
public int cfilen()- Specified by:
cfilenin classOrthomorphic
-
cfllen
public int cfllen()- Specified by:
cfllenin classOrthomorphic
-
cfblen
public int cfblen()- Specified by:
cfblenin classOrthomorphic
-