DMA Release 0.8  Copyright ©1995 by Genesis Project, Ltd.  All Rights Reserved.





MiscPlanetCoordConverter




Inherits From: MiscCoordConverter : Object
Declared In: misckit/miscgiskit/MiscPlanetCoordConverter.h



Class Description

A MiscPlanetCoordConverter object is able to convert any standard UTM Grid Coordinate to World Coordinates and vice versa. MiscUTMCoord and  its' subclasses rely on it for conversion services.

This converter will respond to the convert:to: method for the following coordinate conversions:

From Class To Class Note
UTM World
World UTM
UKUTM World
World UKUTM
Zone UTM World
World Zone UTM
World World
UKUTM UKUTM
Zone UTM Zone UTM Will always try, but returns NO if zones are different.



For information on the underlying mathematics, refer to:

UK Ordinance Survey Information, "Transverse Mercator Projection, Constants, Formula and Methods",
March 1983

The equations are theoretically accurate to within 1 millimeter going from world to UTM and  approximately .001 second of arc going from UTM to world.  Extra decimal places are stored for the purpose of   slowing error propagation that affects the numbers at the  millimeter scale, not because the extra digits are meaningful in and of  themselves.  If calculations require greater than 1mm accuracy, a different set of equations must be used:

Redfern, JCB, "Transverse Mercator Formulae", 1948, Empire Survey Review, 9(69) pg318-322



Instance Variables

MiscUTMConstants *xlate;
double sinPhi;
double sin2Phi;
double rho;
double nu;
double etaSqrd;
double M;

xlate pointer to the MiscUTMConstants object for direct access to conversion constants.
sinPhi Internal blackboard temporary value: Sin f.
sin2Phi Internal blackboard temporary value: Sin2 f.
rho Internal blackboard temporary value: r.
nu Internal blackboard temporary value: n.
etaSqrd Internal blackboard temporary value: e2.
M Internal blackboard temporary value: Developed Arc of a Meridian from f to the True Origin.



Method Types

Creating new instances + new
- finishUnarchiving
Internal methods for subclassing - blackboardCalc:
- calcM:
- calcPhiPrime:
+ superalloc



Class Methods

alloc

Disables the inherited alloc method to prevent multiple MiscPlanetCoordConverters from being created.  There's only one MiscPlanetCoordConverter for each application; you access it through the new method.  Returns an error message.

See also:  + new




allocFromZone:

Disables the inherited allocFromZone method to prevent multiple MiscPlanetCoordConverters from being created. There's only one MiscPlanetCoordConverter object for each application; you access it through the new method. Returns an error message.

See also:  + new




new

+ new

Create and initialize an instance of MiscPlanetCoordConverter if one does not already exist.  If one already exists, return it.  The new instance is registered so that it can also act as a subcontractor for other convertors.

See also:  - free




superalloc

+ superalloc

Internal use only.  Since normal alloc's are disabled, but we still must allow for subclasses that ALSO have only one instance, we have supplied this backdoor for allocation.  Only for use by subclass writers.

See also:  + new





Instance Methods


finishUnarchiving
- finishUnarchiving

A finishUnarchiving message is sent after the MiscPlanetCoordConverter object has been read in from a stream.  This method substitutes an existing one substituted for it.  self is freed and the existing  object is returned.




Internal Instance Methods


blackboardCalc:
- (void)blackboardCalc: (double) phi

Internal use only.  Calculate values for sinPhi, sin2Phi, rho, and etaSqrd. Uses xlate as a pointer to directly access data in a MiscUTMConstants object.  Useful for subclass writers who have in depth knowledge of the internal code.

See also:   - calcM:,  - calcPhiPrime:




calcM:
- (double)calcM: (double) phi

Internal use only. Calculate value for M given the value of phi as an argument. Uses xlate as a pointer to directly access data in a MiscUTMConstants object. Useful for subclass writers who have in depth knowledge of the internal code. Returns M.

See also:  - blackboardCalc:, - calcPhiPrime:




calcPhiPrime:

- (double)calcPhiPrime: (double) N

Internal use only. Calculate a guess value for phi given the value of N (grid Northings) as an argument. Uses xlate as a pointer to directly access data in a MiscUTMConstants object. Useful for subclass writers who have in depth knowledge of the internal code. Returns phi.

See also:  - blackboardCalc:, - calcM: