/*========================== 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 <MiscFoundation/MiscIrelandUTMCoord.h>
#import "_MiscError.h"

@implementation MiscIrelandUTMCoord

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

static id theIrishGrid = nil;

+ makeGrid
  {
   if (!theIrishGrid)
	{theIrishGrid = [[MiscUTMConstants allocWithZone:[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: (NSString *) 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: (NSString *) txt constants: anObject
{	MISC_ERROR_BAIL;
	return self;
 }

/*===========================================================================*/
/* Archive methods */
/*===========================================================================*/
- initWithCoder:(NSCoder *)aCoder
{	self = [super initWithCoder:aCoder];
	[constants setUnprotected];
	[constants release];
	[MiscIrelandUTMCoord makeGrid];
	return self;
}

@end
