UNCLASSIFIED

GeographicTranslator
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
EllipsoidLibraryImplementation.cpp
Go to the documentation of this file.
1 // CLASSIFICATION: UNCLASSIFIED
2 
3 /****************************************************************************/
4 /* RSC IDENTIFIER: Ellipsoid Library Implementation
5  *
6  * ABSTRACT
7  *
8  * The purpose of ELLIPSOID is to provide access to ellipsoid parameters
9  * for a collection of common ellipsoids. A particular ellipsoid can be
10  * accessed by using its standard 2-letter code to find its index in the
11  * ellipsoid table. The index can then be used to retrieve the ellipsoid
12  * name and parameters.
13  *
14  * By sequentially retrieving all of the ellipsoid codes and/or names, a
15  * menu of the available ellipsoids can be constructed. The index values
16  * resulting from selections from this menu can then be used to access the
17  * parameters of the selected ellipsoid.
18  *
19  * This component depends on a data file named "ellips.dat", which contains
20  * the ellipsoid parameter values. A copy of this file must be located in
21  * the directory specified by the environment variable "MSPCCS_DATA", if
22  * defined, or else in the current directory, whenever a program containing
23  * this component is executed.
24  *
25  * Additional ellipsoids can be added to this file, either manually or using
26  * the Create_Ellipsoid function. However, if a large number of ellipsoids
27  * are added, the ellipsoid table array size in this component will have to
28  * be increased.
29  *
30  * ERROR HANDLING
31  *
32  * This component checks parameters for valid values. If an invalid value
33  * is found, the error code is combined with the current error code using
34  * the bitwise or. This combining allows multiple error codes to be
35  * returned. The possible error codes are:
36  *
37  * ELLIPSE_NO_ERROR : No errors occured in function
38  * ELLIPSE_FILE_OPEN_ERROR : Ellipsoid file opening error
39  * ELLIPSE_INITIALIZE_ERROR : Ellipsoid table can not initialize
40  * ELLIPSE_NOT_INITIALIZED_ERROR: Ellipsoid table not initialized properly
41  * ELLIPSE_INVALID_INDEX_ERROR : Index is an invalid value
42  * ELLIPSE_INVALID_CODE_ERROR : Code was not found in table
43  * ELLIPSE_A_ERROR : Semi-major axis less than or equal to zero
44  * ELLIPSE_INV_F_ERROR : Inverse flattening outside of valid range
45  * (250 to 350)
46  * ELLIPSE_NOT_USERDEF_ERROR : Ellipsoid is not user defined - cannot be
47  * deleted
48  *
49  * REUSE NOTES
50  *
51  * Ellipsoid is intended for reuse by any application that requires Earth
52  * approximating ellipsoids.
53  *
54  * REFERENCES
55  *
56  * Further information on Ellipsoid can be found in the Reuse Manual.
57  *
58  * Ellipsoid originated from : U.S. Army Topographic Engineering Center (USATEC)
59  * Geospatial Information Division (GID)
60  * 7701 Telegraph Road
61  * Alexandria, VA 22310-3864
62  *
63  * LICENSES
64  *
65  * None apply to this component.
66  *
67  * RESTRICTIONS
68  *
69  * Ellipsoid has no restrictions.
70  *
71  * ENVIRONMENT
72  *
73  * Ellipsoid was tested and certified in the following environments
74  *
75  * 1. Solaris 2.5
76  * 2. Windows 95
77  *
78  * MODIFICATIONS
79  *
80  * Date Description
81  * ---- -----------
82  * 11-19-95 Original Code
83  * 17-Jan-97 Moved local constants out of public interface
84  * Improved efficiency in algorithms (GEOTRANS)
85  * 24-May-99 Added user-defined ellipsoids (GEOTRANS for JMTK)
86  * 06-27-06 Moved data file to data directory
87  * 03-09-07 Original C++ Code
88  * 06-11-10 S. Gillis, BAEts26724, Fixed memory error problem
89  * when MSPCCS_DATA is not set
90  * 07-07-10 K.Lam, BAEts27269, Replace C functions in threads.h
91  * with C++ methods in classes CCSThreadMutex
92  * 05-16-11 T. Thompson, BAEts27393, Inform user when MSPCCS_DATA
93  * is not defined.
94  * 07/17/12 S.Gillis,MSP_00029561,Fixed problem with creating and
95  * deleting ellipsoid
96  */
97 
98 
99 /***************************************************************************/
100 /*
101  * INCLUDES
102  */
103 
104 #include <stdlib.h>
105 #include <ctype.h>
106 #include <stdio.h>
107 #include <string.h>
109 #include "Ellipsoid.h"
112 #include "ErrorMessages.h"
113 #include "CCSThreadMutex.h"
114 #include "CCSThreadLock.h"
115 
116 #ifdef NDK_BUILD
117 #include <string>
118 #include <iostream>
119 #include <sstream>
120 #include <android/log.h>
121 
122 using namespace std;
123 
124 #define LOGW(...) ((void)__android_log_print(ANDROID_LOG_WARN, "GtApp", __VA_ARGS__))
125 #endif
126 
127 
128 /*
129  * ctype.h - standard C character handling library
130  * stdio.h - standard C input/output library
131  * stdlib.h - standard C general utilities library
132  * string.h - standard C string handling library
133  * DatumLibraryImplementation.h - used to determine
134  * if user defined ellipsoid is in use by a user defined datum
135  * EllipsoidLibraryImplementation.h - prototype error checking and error codes
136  * Ellipsoid.h - used to store individual ellipsoid information
137  * threads.h - used for thread safety
138  * CoordinateConversionException.h - Exception handler
139  * ErrorMessages.h - Contains exception messages
140  */
141 
142 
143 using namespace MSP::CCS;
144 using MSP::CCSThreadMutex;
145 using MSP::CCSThreadLock;
146 
147 
148 /***************************************************************************/
149 /* DEFINES
150  *
151  */
152 
153 const int ELLIPSOID_CODE_LENGTH = 3; /* Length of ellipsoid code (including null) */
154 const int ELLIPSOID_NAME_LENGTH = 30; /* Max length of ellipsoid name */
155 const int ELLIPSOID_BUF = 90;
156 const int FILENAME_LENGTH = 128;
157 const char *WGS84_Ellipsoid_Code = "WE";
158 const char *WGS72_Ellipsoid_Code = "WD";
159 
160 
161 /************************************************************************/
162 /* FUNCTIONS
163  *
164  */
165 
166 /* This class is a safeguard to make sure the singleton gets deleted
167  * when the application exits
168  */
169 namespace MSP
170 {
171  namespace CCS
172  {
174 {
175  public:
176 
178  {
179  CCSThreadLock lock(&EllipsoidLibraryImplementation::mutex);
180  EllipsoidLibraryImplementation::deleteInstance();
181  }
182 
184  }
185 }
186 
187 // Make this class a singleton, so the data file is only initialized once
188 CCSThreadMutex EllipsoidLibraryImplementation::mutex;
189 EllipsoidLibraryImplementation* EllipsoidLibraryImplementation::instance = 0;
190 int EllipsoidLibraryImplementation::instanceCount = 0;
191 
192 
193 EllipsoidLibraryImplementation* EllipsoidLibraryImplementation::getInstance()
194 {
195  CCSThreadLock lock(&mutex);
196  if( instance == 0 )
197  instance = new EllipsoidLibraryImplementation;
198 
199  instanceCount++;
200 
201  return instance;
202 }
203 
204 
205 void EllipsoidLibraryImplementation::removeInstance()
206 {
207 /*
208  * The function removeInstance removes this EllipsoidLibraryImplementation instance from the
209  * total number of instances.
210  */
211  CCSThreadLock lock(&mutex);
212  if( --instanceCount < 1 )
213  {
214  deleteInstance();
215  }
216 }
217 
218 
219 void EllipsoidLibraryImplementation::deleteInstance()
220 {
221 /*
222  * Delete the singleton.
223  */
224 
225  if( instance != 0 )
226  {
227  delete instance;
228  instance = 0;
229  }
230 }
231 
232 
233 EllipsoidLibraryImplementation::EllipsoidLibraryImplementation():
234  _datumLibraryImplementation( 0 )
235 {
236  /*
237  * The constructor loads ellipsoids from data file.
238  */
239  loadEllipsoids();
240 }
241 
242 
244 {
245  int size = el.ellipsoidList.size();
246  for( int i = 0; i < size; i++ )
247  ellipsoidList.push_back( new Ellipsoid( *( el.ellipsoidList[i] ) ) );
248 
249  _datumLibraryImplementation = el._datumLibraryImplementation;
250 }
251 
252 
254 {
255  std::vector<Ellipsoid*>::iterator iter = ellipsoidList.begin();
256  while( iter != ellipsoidList.end() )
257  {
258  delete( *iter );
259  iter++;
260  }
261  ellipsoidList.clear();
262 
263  _datumLibraryImplementation = 0;
264 }
265 
266 
268 {
269  if ( &el == this )
270  return *this;
271 
272  int size = el.ellipsoidList.size();
273  for( int i = 0; i < size; i++ )
274  ellipsoidList[i] = new Ellipsoid( *( el.ellipsoidList[i] ) );
275 
276  _datumLibraryImplementation = el._datumLibraryImplementation;
277 
278  return *this;
279 }
280 
281 
282 void EllipsoidLibraryImplementation::defineEllipsoid( const char* code, const char* name, double semiMajorAxis, double flattening )
283 {
284 /*
285  * The function defineEllipsoid creates a new ellipsoid with the specified
286  * Code, name, and axes. If the ellipsoid table has not been initialized,
287  * the specified code is already in use, or a new version of the ellips.dat
288  * file cannot be created, an exception is thrown.
289  * Note that the indexes of all ellipsoids in the ellipsoid
290  * table may be changed by this function.
291  *
292  * code : 2-letter ellipsoid code. (input)
293  * name : Name of the new ellipsoid (input)
294  * semiMajorAxis : Semi-major axis, in meters, of new ellipsoid (input)
295  * flattening : Flattening of new ellipsoid. (input)
296  *
297  */
298 
299  long code_length = 0;
300  char *PathName = NULL;
301  char FileName[FILENAME_LENGTH];
302  char ellipsoid_code[ELLIPSOID_CODE_LENGTH];
303  FILE *fp = NULL; /* File pointer to file ellips.dat */
304  long index = 0;
305  long numEllipsoids = ellipsoidList.size();
306  double inv_f = 1 / flattening;
307 
308 #ifdef NDK_BUILD
309  __android_log_print(ANDROID_LOG_VERBOSE, "GtApp", "numEllipsoid %d ", numEllipsoids );
310 #endif
311 
312  // assume the ellipsoid code is new
313  bool isNewEllipsoidCode = true;
314  try
315  {
316  // check if ellipsoid code exists
317  ellipsoidIndex( code, &index );
318  // get here if ellipsoid code is found in current ellipsoid table
319  isNewEllipsoidCode = false;
320  }
322  {
323  // the ellipsoid code is new, keep going
324  }
325 
326  // the ellipsoid code exists in current ellipsoid table, throw an error
327  if ( !isNewEllipsoidCode )
329 
330  code_length = strlen( code );
331 
332  if( ( code_length > ( ELLIPSOID_CODE_LENGTH - 1 ) ) )
334  if( semiMajorAxis <= 0.0 )
336  if( (inv_f < 250 ) || ( inv_f > 350 ) )
337  { /* Inverse flattening must be between 250 and 350 */
339  }
340 
341  strcpy( ellipsoid_code, code );
342  /* Convert code to upper case */
343  for( int i = 0; i < code_length; i++ )
344  ellipsoid_code[i] = ( char )toupper( ellipsoid_code[i] );
345 
346  double semiMinorAxis = semiMajorAxis * ( 1 - flattening );
347  double eccentricitySquared = 2.0 * flattening - flattening * flattening;
348  ellipsoidList.push_back( new Ellipsoid( index, ellipsoid_code, ( char* )name,
349  semiMajorAxis, semiMinorAxis, flattening, eccentricitySquared, true ) );
350 
351  numEllipsoids++;
352 
353  CCSThreadLock lock(&mutex);
354 
355  /*output updated ellipsoid table*/
356  PathName = getenv( "MSPCCS_DATA" );
357  if( PathName != NULL )
358  {
359  strcpy( FileName, PathName );
360  strcat( FileName, "/" );
361  }
362  else
363  {
364  strcpy( FileName, "../../data/" );
365  }
366  strcat( FileName, "ellips.dat" );
367 
368  if( ( fp = fopen( FileName, "w" ) ) == NULL )
369  { /* fatal error */
371  }
372 
373  /* write file */
374  index = 0;
375  while( index < numEllipsoids )
376  {
377  if( ellipsoidList[index]->userDefined() )
378  {
379  fprintf( fp, "*%-28s %-2s %11.9f %12.9f %13.13f \n",
380  ellipsoidList[index]->name(),
381  ellipsoidList[index]->code(),
382  ellipsoidList[index]->semiMajorAxis(),
383  ellipsoidList[index]->semiMinorAxis(),
384  1 / ellipsoidList[index]->flattening() );
385  }
386  else
387  {
388  fprintf( fp, "%-29s %-2s %11.9f %12.9f %13.13f \n",
389  ellipsoidList[index]->name(),
390  ellipsoidList[index]->code(),
391  ellipsoidList[index]->semiMajorAxis(),
392  ellipsoidList[index]->semiMinorAxis(),
393  1 / ellipsoidList[index]->flattening() );
394  }
395  index++;
396  }
397 
398  fclose( fp );
399 }
400 
401 
403 {
404 /*
405  * The function removeEllipsoid deletes a user defined ellipsoid with
406  * the specified Code. If the ellipsoid table has not been created,
407  * the specified code is in use by a user defined datum, or a new version
408  * of the ellips.dat file cannot be created, an exception is thrown.
409  * Note that the indexes of all
410  * ellipsoids in the ellipsoid table may be changed by this function.
411  *
412  * code : 2-letter ellipsoid code. (input)
413  *
414  */
415 
416  long index = 0;
417  char *PathName = NULL;
418  char FileName[FILENAME_LENGTH];
419  FILE *fp = NULL; /* File pointer to file ellips.dat */
420 
421  ellipsoidIndex( code, &index );
422  if( ellipsoidList[index]->userDefined() )
423  {
424  if( _datumLibraryImplementation )
425  {
426  if( _datumLibraryImplementation->datumUsesEllipsoid( code ) )
428  }
429  }
430  else
432 
433  ellipsoidList.erase( ellipsoidList.begin() + index );
434 
435  int numEllipsoids = ellipsoidList.size();
436 
437  CCSThreadLock lock(&mutex);
438 
439  /*output updated ellipsoid table*/
440  PathName = getenv( "MSPCCS_DATA" );
441  if( PathName != NULL )
442  {
443  strcpy( FileName, PathName );
444  strcat( FileName, "/" );
445  }
446  else
447  {
448  strcpy( FileName, "../../data/" );
449  }
450  strcat( FileName, "ellips.dat" );
451  if( ( fp = fopen( FileName, "w" ) ) == NULL )
452  { /* fatal error */
454  }
455  /* write file */
456  index = 0;
457  while( index < numEllipsoids )
458  {
459  if( ellipsoidList[index]->userDefined() )
460  {
461  fprintf(fp, "*%-28s %-2s %11.3f %12.4f %13.9f \n",
462  ellipsoidList[index]->name(),
463  ellipsoidList[index]->code(),
464  ellipsoidList[index]->semiMajorAxis(),
465  ellipsoidList[index]->semiMinorAxis(),
466  1 / ellipsoidList[index]->flattening() );
467  }
468  else
469  {
470  fprintf(fp, "*%-29s %-2s %11.3f %12.4f %13.9f \n",
471  ellipsoidList[index]->name(),
472  ellipsoidList[index]->code(),
473  ellipsoidList[index]->semiMajorAxis(),
474  ellipsoidList[index]->semiMinorAxis(),
475  1 / ellipsoidList[index]->flattening() );
476  }
477  index++;
478  }
479 
480  fclose( fp );
481 }
482 
483 
485 {
486 /*
487  * The function ellipsoidCount returns the number of ellipsoids in the
488  * ellipsoid table. If the ellipsoid table has not been initialized,
489  * an exception is thrown.
490  *
491  * count : The number of ellipsoids in the ellipsoid table. (output)
492  *
493  */
494 
495  *count = ellipsoidList.size();
496 }
497 
498 
499 void EllipsoidLibraryImplementation::ellipsoidIndex( const char *code, long* index )
500 {
501 /*
502  * The function ellipsoidIndex returns the index of the ellipsoid in
503  * the ellipsoid table with the specified code. If ellipsoid code is not found,
504  * an exception is thrown.
505  *
506  * code : 2-letter ellipsoid code. (input)
507  * index : Index of the ellipsoid in the ellipsoid table with the
508  * specified code (output)
509  *
510  */
511 
512  char temp_code[3];
513  long i = 0; /* index for ellipsoid table */
514  long j = 0;
515 
516  while( j < ELLIPSOID_CODE_LENGTH )
517  {
518  temp_code[j] = ( char )toupper(code[j]);
519  j++;
520  }
521  temp_code[ELLIPSOID_CODE_LENGTH - 1] = 0;
522 
523  int numEllipsoids = ellipsoidList.size();
524 
525 #ifdef NDK_BUILD
526  __android_log_print(ANDROID_LOG_VERBOSE, "GtApp", "ellipsoid code %s %d ", code, numEllipsoids );
527 #endif
528 
529  while( ( i < numEllipsoids )
530  && strcmp( temp_code, ellipsoidList[i]->code() ) )
531  {
532  i++;
533  }
534 
535  if( i == numEllipsoids )
537  else
538  {
539  if ( strcmp( temp_code, ellipsoidList[i]->code() ) )
541  else
542  *index = i;
543  }
544 }
545 
546 
547 void EllipsoidLibraryImplementation::ellipsoidCode( const long index, char *code )
548 {
549 /*
550  * The Function ellipsoidCode returns the 2-letter code for the
551  * ellipsoid in the ellipsoid table with the specified index. If index is
552  * invalid, an exception is thrown.
553  *
554  * index : Index of a given ellipsoid in the ellipsoid table (input)
555  * code : 2-letter ellipsoid code. (output)
556  *
557  */
558 
559  strcpy( code, "" );
560 
561  if ( ( index < 0 ) || ( index >= ellipsoidList.size() ) )
563  else
564  strcpy( code, ellipsoidList[index]->code() );
565 }
566 
567 
568 void EllipsoidLibraryImplementation::ellipsoidName( const long index, char *name )
569 {
570 /*
571  * The function ellipsoidName returns the name of the ellipsoid in
572  * the ellipsoid table with the specified index. If index is invalid,
573  * an exception is thrown.
574  *
575  * index : Index of a given ellipsoid.in the ellipsoid table with the
576  * specified index (input)
577  * name : Name of the ellipsoid referencd by index (output)
578  *
579  */
580 
581  strcpy( name,"" );
582 
583  if( ( index < 0 ) || ( index >= ellipsoidList.size() ) )
585  else
586  strcpy( name, ellipsoidList[index]->name() );
587 }
588 
589 
590 void EllipsoidLibraryImplementation::ellipsoidParameters( const long index, double *a, double *f )
591 {
592 /*
593  * The function ellipsoidParameters returns the semi-major axis and flattening
594  * for the ellipsoid with the specified index. If index is invalid,
595  * exception is thrown.
596  *
597  * index : Index of a given ellipsoid in the ellipsoid table (input)
598  * a : Semi-major axis, in meters, of ellipsoid (output)
599  * f : Flattening of ellipsoid. (output)
600  *
601  */
602 
603  *a = 0;
604  *f = 0;
605 
606  if( ( index < 0 ) || ( index >= ellipsoidList.size() ) )
608  else
609  {
610  Ellipsoid* ellipsoid = ellipsoidList[index];
611  *a = ellipsoid->semiMajorAxis();
612  *f = ellipsoid->flattening();
613  }
614 }
615 
616 
617 void EllipsoidLibraryImplementation::ellipsoidEccentricity2( const long index, double *eccentricitySquared )
618 {
619 /*
620  * The function ellipsoidEccentricity2 returns the square of the
621  * eccentricity for the ellipsoid with the specified index. If index is
622  * invalid, an exception is thrown.
623  *
624  * index : Index of a given ellipsoid in the ellipsoid table (input)
625  * eccentricitySquared : Square of eccentricity of ellipsoid (output)
626  *
627  */
628 
629  *eccentricitySquared = 0;
630 
631  if( ( index < 0 ) || ( index >= ellipsoidList.size() ) )
633  else
634  *eccentricitySquared = ellipsoidList[index]->eccentricitySquared();
635 }
636 
637 
638 void EllipsoidLibraryImplementation::ellipsoidUserDefined( const long index, long *result )
639 {
640 /*
641  * The function ellipsoidUserDefined returns 1 if the ellipsoid is user
642  * defined. Otherwise, 0 is returned. If index is invalid,
643  * an exception is thrown.
644  *
645  * index : Index of a given ellipsoid in the ellipsoid table (input)
646  * result : Indicates whether specified ellipsoid is user defined (1)
647  * or not (0) (output)
648  *
649  */
650 
651  *result = false;
652 
653  if( ( index < 0 ) || ( index >= ellipsoidList.size() ) )
655  else
656  *result = ellipsoidList[index]->userDefined();
657 }
658 
659 
661 {
662 /*
663  * The function setDatumLibraryImplementation sets the datum library information
664  * which is needed to ensure a user defined ellipsoid is not in use before being deleted.
665  *
666  * __datumLibraryImplementation : Datum library implementation (input)
667  *
668  */
669 
670  _datumLibraryImplementation = __datumLibraryImplementation;
671 }
672 
673 
674 /************************************************************************/
675 /* PRIVATE FUNCTIONS
676  *
677  */
678 
679 void EllipsoidLibraryImplementation::loadEllipsoids()
680 {
681 /*
682  * The function loadEllipsoids reads ellipsoid data from ellips.dat
683  * and builds the ellipsoid table from it. If an error occurs, an
684  * exception is thrown.
685  */
686 
687  char* PathName = NULL;
688  char* FileName = 0;
689  FILE* fp = NULL; /* File pointer to file ellips.dat */
690  char buffer[ELLIPSOID_BUF];
691  long index = 0; /* Array index */
692 
693  CCSThreadLock lock(&mutex);
694 
695  /* Check the environment for a user provided path, else current directory; */
696  /* Build a File Name, including specified or default path: */
697 
698 #ifdef NDK_BUILD
699  PathName = "/data/data/com.baesystems.msp.geotrans/lib/";
700  FileName = new char[ 80 ];
701  strcpy( FileName, PathName );
702  strcat( FileName, "libellipsdat.so" );
703 #else
704  PathName = getenv( "MSPCCS_DATA" );
705  if (PathName != NULL)
706  {
707  FileName = new char[ strlen( PathName ) + 12 ];
708  strcpy( FileName, PathName );
709  strcat( FileName, "/" );
710  }
711  else
712  {
713  FileName = new char[ 22 ];
714  strcpy( FileName, "../../data/" );
715  }
716  strcat( FileName, "ellips.dat" );
717 #endif
718 
719  /* Open the File READONLY, or Return Error Condition: */
720 
721  if( ( fp = fopen( FileName, "r" ) ) == NULL )
722  {
723  delete [] FileName;
724  FileName = 0;
725 
726  if (NULL == PathName)
727  {
728  throw CoordinateConversionException( "Environment variable undefined: MSPCCS_DATA." );
729  }
730  else
731  {
733  }
734  }
735 
736  /* read file */
737  while( !feof( fp ) )
738  {
739  if( fgets( buffer, ELLIPSOID_BUF, fp ) )
740  {
741  char name[ELLIPSOID_NAME_LENGTH];
742  char code[ELLIPSOID_CODE_LENGTH];
743  double semiMajorAxis;
744  double semiMinorAxis;
745  double recpF;
746 
747  sscanf( buffer, "%30c %s %lf %lf %lf", name, code, &semiMajorAxis, &semiMinorAxis, &recpF );
748 
749  bool userDefined = false; /* Identifies a user defined ellipsoid */
750  if( name[0] == '*' )
751  {
752  userDefined = true;
753  for( int i = 0; i < ELLIPSOID_NAME_LENGTH; i++ )
754  name[i] = name[i+1];
755  }
756 
757  name[ELLIPSOID_NAME_LENGTH - 1] = '\0'; /* null terminate */
758 
759  double flattening = 1 / recpF;
760  double eccentricitySquared = 2.0 * flattening - flattening * flattening;
761 
762 #ifdef NDK_BUILD
763  // LOGW("GtApp: name=%s code=%s recpF=%f", name, code, recpF);
764  __android_log_print(ANDROID_LOG_VERBOSE, "GtApp", "name %s", name);
765  __android_log_print(ANDROID_LOG_VERBOSE, "GtApp", "code %s", code);
766  __android_log_print(ANDROID_LOG_VERBOSE, "GtApp", "major %f", semiMajorAxis);
767  __android_log_print(ANDROID_LOG_VERBOSE, "GtApp", "minor %f", semiMinorAxis);
768  __android_log_print(ANDROID_LOG_VERBOSE, "GtApp", "recpF %f", recpF);
769 #endif
770 
771  ellipsoidList.push_back( new Ellipsoid( index, code, name, semiMajorAxis, semiMinorAxis, flattening, eccentricitySquared, userDefined ) );
772 
773  index++;
774  }
775  }
776 
777  fclose( fp );
778 
779  delete [] FileName;
780  FileName = 0;
781 }
782 
783 // CLASSIFICATION: UNCLASSIFIED