/*========================== MiscIrelandUTMCoord.m ==========================*/
/* MiscIrelandUTMCoord class contains and supports values representing
   locations in an Irish Universal Transverse Mercator coordinate system
   with airy values from post 1953 addendum.

   DMA Release 0.8, Copyright @1993 by Genesis Project, Ltd. All Rights
   Reserved. For further information on terms and conditions see:
		Documentation/GISKit/Agreements-Legal-README

HISTORY
21-Mar-93  Dale Amon at GPL
	   Created.
*/

#import <misckit/miscgiskit.h>

@implementation MiscIrelandUTMCoord

/*===========================================================================*/
/* Internal methods */
/*===========================================================================*/

static id theIrishGrid = nil;

+ makeGrid
  {
   if (!theIrishGrid)
	{theIrishGrid = [[MiscUTMConstants allocFromZone: [self zone]]
		       initGridName: "Irish Grid"
			 trueOrigin: 53.5 : -8.0
			     inGrid: 200000.0    : 250000.0
			   onSphere: 6377563.396 : 6356256.910
	     centralMeridianScaling: 1.000035];
	 [theIrishGrid setProtected];
	}
    return theIrishGrid;
  }


/*===========================================================================*/
/* Initialization methods. If we don't already have a UTM constants object
   for the Irish Grid, create one instance that all will share and that
   cannot be deleted.

   Values are from the Irish Ordinance Survey document, "Tables for the
   Transverse Mercator Projection of Ireland", 1953, reprinted 1971, with
   addendum for modified airy sphere.

*/
/*===========================================================================*/
/* DESIGNATED INITIALIZER */

-initDescription: (char *) txt
 {
    
    [super initDescription: txt constants: [MiscIrelandUTMCoord makeGrid]];

    /* over ride the standard converter */
    converter = [MiscIrelandCoordConverter new];
    return self;
 }


/*---------------------------------------------------------------------------*/
/* Block the designated initializer of our parent class */

-initDescription: (char *) txt constants: anObject
 {	[self error:"  %s class should not be sent '%s' messages\n",
            [[self class] name], sel_getName(_cmd)];
	return self;
 }

/*===========================================================================*/
/* Archive methods */
/*===========================================================================*/
- awake
{	[super awake];
	[constants setUnprotected];
	[constants free];
	[MiscIrelandUTMCoord makeGrid];
	return self;
}

@end
