OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimBngProjection.cpp
Go to the documentation of this file.
1 //*******************************************************************
2 // Copyright (C) 2000 ImageLinks Inc.
3 //
4 // License: See top LICENSE.txt file.
5 //
6 // Author: Garrett Potts
7 //
8 //*******************************************************************
9 // $Id: ossimBngProjection.cpp 17815 2010-08-03 13:23:14Z dburken $
16 
17 #include <string.h>
18 #include <stdio.h>
19 
20 #define BNG_NO_ERROR 0x0000
21 #define BNG_LAT_ERROR 0x0001
22 #define BNG_LON_ERROR 0x0002
23 #define BNG_EASTING_ERROR 0x0004
24 #define BNG_NORTHING_ERROR 0x0008
25 #define BNG_INVALID_AREA_ERROR 0x0010
26 #define BNG_STRING_ERROR 0x0020
27 #define BNG_ELLIPSOID_ERROR 0x0040
28 
29 #define PI_OVER_2 (M_PI / 2.0e0) /* PI over 2 */
30 #define MAX_LAT (61.5 * M_PI / 180.0) /* 61.5 degrees */
31 #define MIN_LAT (49.5 * M_PI / 180.0) /* 49.5 degrees */
32 #define MAX_LON (3.5 * M_PI / 180.0) /* 3.5 degrees */
33 #define MIN_LON (-10.0 * M_PI / 180.0) /* -10 degrees */
34 #define BNG500GRID "STNOHJ" /* 500,000 unit square identifications */
35 #define BNG100GRID "VWXYZQRSTULMNOPFGHJKABCDE" /* 100,000 unit square identifications */
36 static double BNG_Max_Easting = 759961.0;
37 static double BNG_Max_Northing = 1257875.0;
38 static double BNG_Min_Easting = -133134.0;
39 static double BNG_Min_Northing = -14829.0;
40 
41 static char BNG_Letters[3] = "SV";
42 static double BNG_Easting = 0.0;
43 static double BNG_Northing = 0.0;
44 static const char* Airy = "AA";
45 static char BNG_Ellipsoid_Code[3] = "AA";
46 
47 RTTI_DEF1(ossimBngProjection, "ossimBngProjection", ossimMapProjection);
48 
50  :ossimMapProjection(*ossimEllipsoidFactory::instance()->create("AA"),
51  ossimGpt(49.0, -2.0, ossim::nan(),
52  ossimDatumFactory::instance()->create(ossimString("OGB-M"))))
53 {
54  string_Broken = 0;
56  update();
57 }
58 
59 
60 ossimGpt ossimBngProjection::inverse(const ossimDpt &eastingNorthing)const
61 {
62  char s[100];
63  double lat;
64  double lon;
65 
66  string_Broken = 0;
70 
71  Convert_Transverse_Mercator_To_BNG(eastingNorthing.x,
72  eastingNorthing.y,
73  5,
74  s);
76  &lat,
77  &lon);
78  ossimGpt result(49, -2, ossim::nan(),theDatum);
79  result.latr(lat);
80  result.lonr(lon);
81 
82  return result;
83 }
84 
86 {
87  char BNG[100];
88 
89  string_Broken = 0;
93 
94  Convert_Geodetic_To_BNG (latLon.latr(),
95  latLon.lonr(),
96  5,
97  BNG);
98 
99  ossimDpt en;
100 
102  &en.x,
103  &en.y);
104 
105  return en;
106 }
107 
109 {
110  BNG_Origin_Lat = (49.0 * M_PI / 180.0);
111  BNG_Origin_Long = (-2.0 * M_PI / 180.0);
112  BNG_False_Northing = -100000.0;
113  BNG_False_Easting = 400000.0;
114  BNG_Scale_Factor = .9996012717;
115  BNG_a = 6377563.396;
116  BNG_f = 1 / 299.324964600;
117 
118  // ossimString code = theDatum->code();
119  // if(code.upcase().contains("OGB"))
120  // {
121 
122  theOrigin = ossimGpt(49.0, -2.0, ossim::nan(), theDatum);
125 
126  // }
127  // else
128 // {
129 // theOrigin = ossimGpt(49.0, -2.0, ossim::nan(), ossimDatumFactory::instance()->create("OGB-7"));
130 // }
131 
133 }
134 
140  const char* prefix)const
141 {
142  kwl.add(prefix,
144  getClassName(),
145  true);
146 
147  kwl.add(prefix,
150  true);
151 
152  return ossimMapProjection::saveState(kwl, prefix);
153 }
154 
160  const char* prefix)
161 {
162 
163  ossimMapProjection::loadState(kwl, prefix);
164 
165  update();
166 
167  return true;
168 }
169 
170 
172  const char* letter_Array,
173  long *index)const
174 {
175 /*
176  * The function Find_Index searches for a given letter in an array.
177  * It returns the index of the letter in the array if the letter is found.
178  * If the letter is not found, an error code is returned, otherwise
179  * BNG_NO_ERROR is returned.
180  *
181  * letter : Letter being searched for
182  * letter_Array : Array being searched
183  * index : Index of letter in array
184  */
185  ossim_uint32 i = 0;
186  ossim_uint32 not_Found = 1;
187  ossim_uint32 length = (ossim_uint32)strlen(letter_Array);
188  ossim_uint32 Error_Code = BNG_NO_ERROR;
189 
190  while ((i < length) && (not_Found))
191  {
192  if (letter == letter_Array[i])
193  {
194  *index = i;
195  not_Found = 0;
196  }
197  i++;
198  }
199  if (not_Found)
200  Error_Code = BNG_STRING_ERROR;
201 
202  return Error_Code;
203 }
204 
205 long ossimBngProjection::Round_BNG (double value)const
206 /* Round value to nearest integer, using standard engineering rule */
207 { /* Round_BNG */
208  double ivalue;
209  long ival;
210  double fraction = modf (value, &ivalue);
211  ival = (long)(ivalue);
212  if ((fraction > 0.5) || ((fraction == 0.5) && (ival%2 == 1)))
213  ival++;
214 
215  return (ival);
216 }
217 
219  long Easting,
220  long Northing,
221  char* BNG,
222  long Precision)const
223 
224 { /* Make_BNG_String */
225 /* Construct a BNG string from its component parts */
226  double divisor;
227  long east;
228  long north;
229  long i;
230  long j;
231  double unitInterval;
232  long error_code = BNG_NO_ERROR;
233 
234  i = 0;
235  for (j = 0; j < 3; j++)
236  {
237  BNG[i++] = ltrnum[j];
238  }
239 
240  divisor = pow ((double)10.0,(double) (5 - Precision));
241  unitInterval = pow ((double)10.0, (double)Precision);
242  east = Round_BNG (Easting/divisor);
243  if (east == unitInterval)
244  east -= 1;
245  if ((Precision == 0) && (east == 1))
246  east = 0;
247  i += sprintf (BNG + i, "%*.*ld",(int) Precision,(int) Precision, east);
248 
249  north = Round_BNG (Northing/divisor);
250  if (north == unitInterval)
251  north -= 1;
252  if ((Precision == 0) && (north == 1))
253  north = 0;
254  i += sprintf (BNG + i, "%*.*ld",(int) Precision,(int) Precision, north);
255 
256  return (error_code);
257 } /* Make_BNG_String */
258 
260  char Letters[3],
261  double* Easting,
262  double* Northing,
263  long* Precision)const
264 /* Break down a BNG string into its component parts */
265 { /* Break_BNG_String */
266  long i = 0;
267  long j;
268  long num_digits = 0;
269  long num_letters;
270  long temp_error = 0;
271  long length = (long)strlen(BNG);
272  long error_code = BNG_NO_ERROR;
273 
274  string_Broken = 1;
275  while (BNG[i] == ' ')
276  i++; /* skip any leading blanks */
277  j = i;
278  while (isalpha(BNG[i]))
279  i++;
280  num_letters = i - j;
281  if (num_letters == 2)
282  {
283  /* get letters */
284  Letters[0] = (char)toupper(BNG[j]);
285  Letters[1] = (char)toupper(BNG[j+1]);
286  Letters[2] = 0;
287  }
288  else
289  error_code |= BNG_STRING_ERROR;
290  if (!error_code)
291  {
292  error_code |= Check_Out_Of_Area(Letters[0], Letters[1]);
293  while (BNG[i] == ' ')
294  i++;
295  j = i;
296  if (BNG[length-1] == ' ')
297  length --;
298  while ((i < length) && (!temp_error))
299  {
300  if (isdigit(BNG[i]))
301  i++;
302  else
303  {
304  temp_error = BNG_STRING_ERROR;
305  }
306  }
307  if (temp_error)
308  error_code |= temp_error;
309  if (!error_code)
310  {
311  num_digits = i - j;
312  if ((num_digits <= 10) && (num_digits%2 == 0))
313  {
314  long n;
315  char east_string[6];
316  char north_string[6];
317  long east;
318  long north;
319  double multiplier;
320 
321  /* get easting & northing */
322  n = num_digits / 2;
323  *Precision = n;
324  if (n > 0)
325  {
326  strncpy (east_string, BNG+j, n);
327  east_string[n] = 0;
328  sscanf (east_string, "%ld", &east);
329  strncpy (north_string, BNG+j+n, n);
330  north_string[n] = 0;
331  sscanf (north_string, "%ld", &north);
332  multiplier = pow ((double)10.0,(double)( 5 - n));
333  *Easting = east * multiplier;
334  *Northing = north * multiplier;
335  }
336  else
337  {
338  *Easting = 0.0;
339  *Northing = 0.0;
340  }
341  }
342  else
343  error_code |= BNG_STRING_ERROR;
344  }
345  }
346  return (error_code);
347 } /* Break_BNG_String */
348 
350  char BNG100)const
351 
352 { /* BEGIN Check_Out_Of_Area */
353 /*
354  * The function Check_Out_Of_Area checks if the 500,000 and
355  * 100,000 unit square identifications are within the valid area. If
356  * they are not, an error code is returned, otherwise BNG_NO_ERROR
357  * is returned.
358  *
359  * BNG500 : 500,000 square unit identification
360  * BNG100 : 100,000 square unit identification
361  */
362 
363  long Error_Code = BNG_NO_ERROR;
364 
365  switch (BNG500)
366  {
367  case 'S':
368  switch (BNG100)
369  {
370  case 'A':
371  case 'F':
372  case 'L':
373  Error_Code |= BNG_INVALID_AREA_ERROR;
374  break;
375  default:
376  break;
377  }
378  break;
379  case 'N':
380  switch (BNG100)
381  {
382  case 'V':
383  Error_Code |= BNG_INVALID_AREA_ERROR;
384  break;
385  default:
386  break;
387  }
388  break;
389 
390  case 'H':
391  if (BNG100 < 'L')
392  Error_Code |= BNG_INVALID_AREA_ERROR;
393  break;
394  case 'T':
395  switch (BNG100)
396  {
397  case 'D':
398  case 'E':
399  case 'J':
400  case 'K':
401  case 'O':
402  case 'P':
403  case 'T':
404  case 'U':
405  case 'X':
406  case 'Y':
407  case 'Z':
408  Error_Code |= BNG_INVALID_AREA_ERROR;
409  break;
410  default:
411  break;
412  }
413  break;
414  case 'O':
415  switch (BNG100)
416  {
417  case 'C':
418  case 'D':
419  case 'E':
420  case 'J':
421  case 'K':
422  case 'O':
423  case 'P':
424  case 'T':
425  case 'U':
426  case 'Y':
427  case 'Z':
428  Error_Code |= BNG_INVALID_AREA_ERROR;
429  break;
430  default:
431  break;
432  }
433  break;
434  case 'J':
435  switch (BNG100)
436  {
437  case 'L':
438  case 'M':
439  case 'Q':
440  case 'R':
441  case 'V':
442  case 'W':
443  Error_Code = BNG_NO_ERROR;
444  break;
445  default:
446  Error_Code |= BNG_INVALID_AREA_ERROR;
447  break;
448  }
449  break;
450  default:
451  Error_Code |= BNG_INVALID_AREA_ERROR;
452  break;
453  }
454  return Error_Code;
455 } /* END OF Check_Out_Of_Area */
456 
457 long ossimBngProjection::Set_BNG_Parameters(char *Ellipsoid_Code)
458 
459 { /* BEGIN Set_BNG_Parameters */
460 /*
461  * The function Set_BNG_Parameters receives the ellipsoid code and sets
462  * the corresponding state variables. If any errors occur, the error code(s)
463  * are returned by the function, otherwise BNG_NO_ERROR is returned.
464  *
465  * Ellipsoid_Code : 2-letter code for ellipsoid (input)
466  */
467 
468  long Error_Code = BNG_NO_ERROR;
469 
470  if (strcmp(Ellipsoid_Code, Airy) != 0)
471  { /* Ellipsoid must be Airy */
472  Error_Code |= BNG_ELLIPSOID_ERROR;
473  }
474 
475  if (!Error_Code)
476  { /* no errors */
477  strcpy(BNG_Ellipsoid_Code, Ellipsoid_Code);
478  string_Broken = 0;
479 
483  }
484  return (Error_Code);
485 } /* END of Set_BNG_Parameters */
486 
487 void ossimBngProjection::Get_BNG_Parameters(char *Ellipsoid_Code)
488 
489 { /* BEGIN Get_BNG_Parameters */
490 /*
491  * The function Get_BNG_Parameters returns the current ellipsoid
492  * code.
493  *
494  * Ellipsoid_Code : 2-letter code for ellipsoid (output)
495  */
496 
497  strcpy(Ellipsoid_Code, BNG_Ellipsoid_Code);
498 
499  return;
500 } /* END OF Get_BNG_Parameters */
501 
503  double Longitude,
504  long Precision,
505  char* BNG)const
506 
507 { /* BEGIN Convert_Geodetic_To_BNG */
508 /*
509  * The function Convert_Geodetic_To_BNG converts geodetic (latitude and
510  * longitude) coordinates to a BNG coordinate string, according to the
511  * current ellipsoid parameters. If any errors occur, the error code(s)
512  * are returned by the function, otherwise BNG_NO_ERROR is returned.
513  *
514  * Latitude : Latitude, in radians (input)
515  * Longitude : Longitude, in radians (input)
516  * Precision : Precision level of BNG string (input)
517  * BNG : British National Grid coordinate string (output)
518  *
519  */
520  double TMEasting, TMNorthing;
521  long Error_Code = BNG_NO_ERROR;
522 
523  if ((Latitude < MIN_LAT) || (Latitude > MAX_LAT))
524  { /* Latitude out of range */
525  Error_Code|= BNG_LAT_ERROR;
526  }
527  if ((Longitude < MIN_LON) || (Longitude > MAX_LON))
528  { /* Longitude out of range */
529  Error_Code|= BNG_LON_ERROR;
530  }
531 
532  if (!Error_Code)
533  { /* no errors */
534 
535  Error_Code |= Convert_Geodetic_To_Transverse_Mercator(Latitude, Longitude, &TMEasting, &TMNorthing);
536 
537  if ((TMEasting < 0.0) && (TMEasting > -2.0))
538  TMEasting = 0.0;
539  if ((TMNorthing < 0.0) && (TMNorthing > -2.0))
540  TMNorthing = 0.0;
541 
542  if ((TMEasting < BNG_Min_Easting) || (TMEasting > BNG_Max_Easting))
543  Error_Code |= BNG_INVALID_AREA_ERROR;
544  if ((TMNorthing < BNG_Min_Northing) || (TMNorthing > BNG_Max_Northing))
545  Error_Code |= BNG_INVALID_AREA_ERROR;
546 
547  if (!Error_Code)
548  Error_Code |= Convert_Transverse_Mercator_To_BNG(TMEasting, TMNorthing, Precision, BNG);
549  }
550  return Error_Code;
551 } /* END OF Convert_Geodetic_To_BNG */
552 
554  double *Latitude,
555  double *Longitude)const
556 
557 { /* Convert_BNG_To_Geodetic */
558 /*
559  * The function Convert_BNG_To_Geodetic converts a BNG coordinate string
560  * to geodetic (latitude and longitude) coordinates, according to the current
561  * ellipsoid parameters. If any errors occur, the error code(s) are returned
562  * by the function, otherwise BNG_NO_ERROR is returned.
563  *
564  * BNG : British National Grid coordinate string (input)
565  * Latitude : Latitude, in radians (output)
566  * Longitude : Longitude, in radians (output)
567  *
568  */
569 
570  double TMEasting, TMNorthing;
571  long in_Precision;
572  long temp_Error = 0;
573  long Error_Code = BNG_NO_ERROR;
574 
575  Error_Code |= Break_BNG_String(BNG, BNG_Letters, &BNG_Easting, &BNG_Northing, &in_Precision);
576 
577  if(!Error_Code)
578  {
579  Error_Code |= Convert_BNG_To_Transverse_Mercator(BNG, &TMEasting, &TMNorthing);
580 
581  if ((TMEasting < BNG_Min_Easting) || (TMEasting > BNG_Max_Easting))
582  Error_Code |= BNG_INVALID_AREA_ERROR;
583  if ((TMNorthing < BNG_Min_Northing) || (TMNorthing > BNG_Max_Northing))
584  Error_Code |= BNG_INVALID_AREA_ERROR;
585 
586  if(!Error_Code)
587  {
588  temp_Error |= Convert_Transverse_Mercator_To_Geodetic(TMEasting, TMNorthing, Latitude, Longitude);
589 
590  if (temp_Error & TRANMERC_EASTING_ERROR)
591  Error_Code |= BNG_EASTING_ERROR;
592  if (temp_Error & TRANMERC_NORTHING_ERROR)
593  Error_Code |= BNG_NORTHING_ERROR;
594 
595  if ((*Latitude < MIN_LAT) || (*Latitude > MAX_LAT))
596  Error_Code|= BNG_INVALID_AREA_ERROR;
597  if ((*Longitude < MIN_LON) || (*Longitude > MAX_LON))
598  Error_Code|= BNG_INVALID_AREA_ERROR;
599  }
600  }
601  return Error_Code;
602 } /* END OF Convert_BNG_To_Geodetic */
603 
604 
606  double Northing,
607  long Precision,
608  char *BNG)const
609 
610 {/* BEGIN Convert_Transverse_Mercator_To_BNG */
611 /*
612  * The function Convert_Transverse_Mercator_To_BNG converts Transverse Mercator
613  * (easting and northing) coordinates to a BNG coordinate string, according
614  * to the current ellipsoid parameters. If any errors occur, the error code(s)
615  * are returned by the function, otherwise BNG_NO_ERROR is returned.
616  *
617  * Easting : Easting (X), in meters (input)
618  * Northing : Northing (Y), in meters (input)
619  * Precision : Precision level of BNG string (input)
620  * BNG : British National Grid coordinate string (output)
621  */
622 
623  char letters[4];
624  long x, y;
625  long index;
626  long temp_Easting, temp_Northing;
627  long Error_Code = BNG_NO_ERROR;
628 
629  if ((Easting < BNG_Min_Easting) || (Easting > BNG_Max_Easting))
630  { /* Easting out of range */
631  Error_Code |= BNG_EASTING_ERROR;
632  }
633  if ((Northing < BNG_Min_Northing) || (Northing > BNG_Max_Northing))
634  { /* Northing out of range */
635  Error_Code |= BNG_NORTHING_ERROR;
636  }
637 
638  if (!Error_Code)
639  { /* no errors */
640  temp_Easting = Round_BNG(Easting);
641  temp_Northing = Round_BNG(Northing);
642 
643  temp_Easting += 1000000;
644  temp_Northing += 500000;
645 
646  x = temp_Easting / 500000;
647  y = temp_Northing / 500000;
648 
649  index = y * 5 + x;
650  if ((index >= 0) && (index < 25))
651  {
652  letters[0] = BNG100GRID[index];
653  temp_Easting %= 500000;
654  temp_Northing %= 500000;
655  x = temp_Easting / 100000;
656  y = temp_Northing / 100000;
657  index = y * 5 + x;
658  if ((index >= 0) && (index < 25))
659  {
660  letters[1] = BNG100GRID[index];
661  Error_Code |= Check_Out_Of_Area(letters[0], letters[1]);
662  if (!Error_Code)
663  {
664  letters[2] = ' ';
665  letters[3] = 0;
666  temp_Easting %= 100000;
667  temp_Northing %= 100000;
668  Make_BNG_String(letters, temp_Easting, temp_Northing, BNG, Precision);
669  }
670  }
671  else
672  {
673  long five_y = 5 * y;
674  if ((x >= (25 - five_y)) || (x < -five_y))
675  Error_Code |= BNG_EASTING_ERROR;
676  if ((five_y >= (25 - x)) || (five_y < -x))
677  Error_Code |= BNG_NORTHING_ERROR;
678  }
679  }
680  else
681  {
682  long five_y = 5 * y;
683  if ((x >= (25 - five_y)) || (x < -five_y))
684  Error_Code |= BNG_EASTING_ERROR;
685  if ((five_y >= (25 - x)) || (five_y < -x))
686  Error_Code |= BNG_NORTHING_ERROR;
687  }
688  }
689  return Error_Code;
690 } /* END OF Convert_Transverse_Mercator_To_BNG */
691 
692 
694  double *Easting,
695  double *Northing)const
696 
697 { /* Convert_BNG_To_Transverse_Mercator */
698 /*
699  * The function Convert_BNG_To_Transverse_Mercator converts a BNG coordinate string
700  * to Transverse Mercator projection (easting and northing) coordinates
701  * according to the current ellipsoid parameters. If any errors occur,
702  * the error code(s) are returned by the function, otherwise BNG_NO_ERROR
703  * is returned.
704  *
705  * BNG : British National Grid coordinate string (input)
706  * Easting : Easting (X), in meters (output)
707  * Northing : Northing (Y), in meters (output)
708  */
709  long northing_Offset, easting_Offset;
710  long i = 0;
711  long j = 0;
712  long in_Precision;
713  long Error_Code = BNG_NO_ERROR;
714 
715  if (!string_Broken)
716  {
717  Error_Code |= Break_BNG_String(BNG, BNG_Letters, &BNG_Easting, &BNG_Northing, &in_Precision);
718  }
719  if (!Error_Code)
720  {
721  Error_Code |= Find_Index(BNG_Letters[0], BNG500GRID, &i);
722  if (!Error_Code)
723  {
724  northing_Offset = 500000 * (i / 2);
725  easting_Offset = 500000 * (i % 2);
726 
727  Error_Code |= Find_Index(BNG_Letters[1], BNG100GRID, &j);
728  if (!Error_Code)
729  {
730  northing_Offset += 100000 * (j / 5);
731  easting_Offset += 100000 * (j % 5);
732 
733  *Easting = BNG_Easting + easting_Offset;
734  *Northing = BNG_Northing + northing_Offset;
735  }
736  }
737  }
738  return Error_Code;
739 } /* END OF Convert_BNG_To_Transverse_Mercator */
740 
741 
742 
virtual const ossimDatum * create(const ossimString &code) const
create method
ossim_uint32 x
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
long Round_BNG(double value) const
long Set_Transverse_Mercator_Parameters(double a, double f, double Origin_Latitude, double Central_Meridian, double False_Easting, double False_Northing, double Scale_Factor)
long Check_Out_Of_Area(char BNG500, char BNG100) const
long Convert_BNG_To_Transverse_Mercator(char *BNG, double *Easting, double *Northing) const
Represents serializable keyword/value map.
ossim_uint32 y
long Convert_Geodetic_To_BNG(double Latitude, double Longitude, long Precision, char *BNG) const
long Make_BNG_String(char ltrnum[4], long Easting, long Northing, char *BNG, long Precision) const
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
This code was derived from https://gist.github.com/mshockwave.
Definition: Barrier.h:8
double y
Definition: ossimDpt.h:165
#define BNG_INVALID_AREA_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
#define MAX_LAT
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
#define BNG_LAT_ERROR
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
static const char * TYPE_KW
#define BNG_NO_ERROR
#define BNG_ELLIPSOID_ERROR
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
#define MAX_LON
#define M_PI
#define BNG_EASTING_ERROR
os2<< "> n<< " > nendobj n
double lonr() const
Returns the longitude in radian measure.
Definition: ossimGpt.h:76
unsigned int ossim_uint32
#define BNG100GRID
static ossimDatumFactory * instance()
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
long Set_BNG_Parameters(char *Ellipsoid_Code)
long Break_BNG_String(char *BNG, char Letters[3], double *Easting, double *Northing, long *Precision) const
#define MIN_LAT
#define BNG_NORTHING_ERROR
long Convert_BNG_To_Geodetic(char *BNG, double *Latitude, double *Longitude) const
#define TRANMERC_NORTHING_ERROR
Definition: ossimTranmerc.h:95
void Get_BNG_Parameters(char *Ellipsoid_Code)
long Convert_Transverse_Mercator_To_BNG(double Easting, double Northing, long Precision, char *BNG) const
long Convert_Transverse_Mercator_To_Geodetic(double Easting, double Northing, double *Latitude, double *Longitude)
#define TRANMERC_EASTING_ERROR
Definition: ossimTranmerc.h:94
long Find_Index(char letter, const char *letter_Array, long *index) const
virtual ossimDpt forward(const ossimGpt &latLon) const
All map projections will convert the world coordinate to an easting northing (Meters).
double x
Definition: ossimDpt.h:164
double latr() const
latr().
Definition: ossimGpt.h:66
#define BNG500GRID
#define BNG_STRING_ERROR
#define MIN_LON
virtual ossimGpt inverse(const ossimDpt &eastingNorthing) const
Will take a point in meters and convert it to ground.
RTTI_DEF1(ossimBngProjection, "ossimBngProjection", ossimMapProjection)
static const char * SCALE_FACTOR_KW
ossimDpt theFalseEastingNorthing
Hold the false easting northing.
#define BNG_LON_ERROR
long Convert_Geodetic_To_Transverse_Mercator(double Latitude, double Longitude, double *Easting, double *Northing)
const ossimDatum * theDatum
This is only set if we want to have built in datum shifting.