OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimDms.cpp
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: See top level LICENSE.txt file.
4 //
5 // Author: Garrett Potts
6 //
7 // Description:
8 //
9 // Contains class definition for Degrees Minutes Seconds (ossimDms)
10 //*******************************************************************
11 // $Id: ossimDms.cpp 19682 2011-05-31 14:21:20Z dburken $
12 
13 #include <cctype> /* for isspace */
14 #include <cmath>
15 #include <cstring> /* for strcpy */
16 #include <cstdio>
17 #include <iomanip>
18 #include <sstream>
19 
20 #include <ossim/base/ossimDms.h>
21 #include <ossim/base/ossimCommon.h>
22 
24 const char* ossimDms::DEFAULT_FORMAT = "ddd mm.mmC";
25 const char* ossimDms::SPACES = " ";
26 
28  : theDegrees(0.0),
29  theLatFlag(true),
30  theDecDegs(0.0),
31  theAfterDot(false),
32  theDoingSeconds(true),
33  theIntDegs(0),
34  theSign(1),
35  theWorking(0.0)
36 {
37 }
38 
39 ossimDms::ossimDms(double someDegrees, bool latFlag)
40  : theDegrees(someDegrees),
41  theLatFlag(latFlag),
42  theDecDegs(0.0),
43  theAfterDot(false),
44  theDoingSeconds(true),
45  theIntDegs(0),
46  theSign(1),
47  theWorking(0.0)
48 {
49 }
50 
51 ossimDms::ossimDms(const std::string& value)
52  : theDegrees(0.0),
53  theLatFlag(false),
54  theDecDegs(0.0),
55  theAfterDot(false),
56  theDoingSeconds(true),
57  theIntDegs(0),
58  theSign(1),
59  theWorking(0.0)
60 {
61  if (value != "")
62  {
64  }
65  else
66  {
67  theDegrees = 0.0;
68  }
69 
70 }
71 
73 {
74  theDegrees = degrees;
75 
76  return *this;
77 }
78 
79 bool ossimDms::setDegrees(const std::string& cdegrees)
80 {
81  bool status = true;
82 
83  ossimString copy = cdegrees;
84 
85  double degrees, factor, dividend, units;
86  int i;
87  bool afterdelim;
88  char* cptr = const_cast<char*>(copy.c_str());
89  char c;
90 
91  theAfterDot = false;
92  afterdelim = false;
93  degrees = 0.0;
94  units = 0.0;
95  factor = 1.0;
96  dividend = 60.0;
97  theSign = 1;
98 
99  /* get rid of leading spaces */
100 
101  while (*cptr == ' ')
102  {
103  cptr++;
104  }
105 
106  while(*cptr != '\0')
107  {
108  switch (*cptr)
109  {
110 
111  // north, west and + values will change sign of degrees to plus.
112 
113  case '+':
114  {
115  theSign = 1;
116  cptr++;
117  }
118  case 'n':
119  case 'N':
120  {
121  theSign = 1;
122  theLatFlag = true;
123  cptr++;
124  break;
125  }
126  case 'e':
127  case 'E':
128  {
129  theLatFlag = false;
130  theSign = 1;
131  cptr++;
132  break;
133  }
134 
135  // south, east and - values will change sign of degrees to minus
136 
137  case '-':
138  {
139  theSign = -1;
140  cptr++;
141  break;
142  }
143  case 's':
144  case 'S':
145  {
146  theSign = -1;
147  cptr++;
148  theLatFlag = true;
149  break;
150  }
151  case 'w':
152  case 'W':
153  {
154  theSign = -1;
155  cptr++;
156  theLatFlag = false;
157  break;
158  }
159 
160  case '0':
161  case '1':
162  case '2':
163  case '3':
164  case '4':
165  case '5':
166  case '6':
167  case '7':
168  case '8':
169  case '9':
170  {
171  c = *cptr;
172  i = (c - '0');
173 
174  if (afterdelim == true)
175  {
176  if (theAfterDot == true)
177  {
178  units = units + (((double)i * factor) / dividend);
179  }
180  else
181  {
182  units = (units * factor) + ((double)i / dividend);
183  }
184  }
185  else
186  {
187  if (theAfterDot == true)
188  {
189  degrees = degrees + ((double)i * factor);
190  }
191  else
192  {
193  degrees = (degrees * factor) + (double)i;
194  }
195  }
196  if (theAfterDot == true)
197  {
198  factor = factor * .10;
199  }
200  else
201  {
202  factor = 10.;
203  }
204 
205  cptr++;
206  break;
207  }
208 
209  //---
210  // a decimal point indicates a change in the factor used
211  // to calculate degrees or units (minutes or seconds)
212  //---
213  case '.':
214  {
215  factor = .10;
216  theAfterDot = true;
217  cptr++;
218  break;
219  }
220 
221  // after a delimiter the value contains minutes, first time through
222  case ' ':
223  case '\"':
224  case '\'':
225  {
226  while (*(cptr + 1) == ' ')
227  {
228  cptr++;
229  }
230 
231  degrees = degrees + units;
232  units = 0.0;
233 
234  if (afterdelim == true) /* must be seconds */
235  {
236  dividend = dividend * dividend;
237  }
238  else
239  {
240  afterdelim = true;
241  }
242 
243  factor = 1.;
244 
245  cptr++;
246 
247  // skip any leading zeroes after delimiter */
248 
249  while (*cptr == '0')
250  {
251  cptr++;
252  }
253 
254  break;
255  }
256 
257  //---
258  // check for a delimiter that is allowable:
259  // isspace allows: space, tab, cr, nl, vt, ff
260  // ispunct allows: punctuation char != space or control or letter
261  //---
262  default:
263  {
264  if(isspace(*cptr) ||
265  ispunct(*cptr) ||
266  ((ossim_uint8)(*cptr) == theDegreeSign))
267  {
268  *cptr = ' ';
269  }
270  else
271  {
272  status = false;
273  ++cptr;
274  }
275  }
276 
277  } // end switch
278 
279  if (status == false)
280  {
281  break;
282  }
283 
284  } // end while loop
285 
286  // add any units that may have been calculated (minutes or seconds)
287  degrees = degrees + units;
288 
289  theDegrees = (degrees * (double)theSign);
290 
291  return status;
292 }
293 
294 ossimString ossimDms::toString(const ossimString& formatString)const
295 {
296  ossimString result="";
297  std::string::const_iterator stringIter;
298  ossimString tempFormatString = formatString;
299  if(formatString == ossimString(""))
300  {
301  tempFormatString = ossimDms::DEFAULT_FORMAT;
302  }
303 
304  stringIter = tempFormatString.begin();
305  int i, d_s;
306 
307 /* assign a default format if none is given */
308 
310 
311  while(stringIter != tempFormatString.end())
312  {
313  switch(*stringIter)
314  {
315  case '-':
316  {
317  result +=(theWorking < 0.0) ? ('-') : (' ');
318  stringIter++;
319  break;
320  }
321 
322  case 'c':
323  case 'C':
324  {
325  char temp;
326  if (theWorking < 0.0)
327  {
328  temp = (theLatFlag == true) ? ('S') : ('W');
329  }
330  else
331  {
332  temp= (theLatFlag == true) ? ('N') : ('E');
333  }
334 
335  if(*stringIter == 'c')
336  {
337  temp = tolower(temp);
338  }
339  result += temp;
340  stringIter++;
341  break;
342  }
343 
344  case 'd':
345  case 'D':
346  { /* how many 'd's until not 'd' */
347  d_s = 1;
348  ++stringIter;
349  while (*stringIter == 'd' || *stringIter == 'D')
350  {
351  ++d_s;
352  ++stringIter;
353  }
354  if (theAfterDot == true)
355  { /* beyond the decimal point */
356  double fractionalDegrees = std::abs(theDegrees-(int)theDegrees);
357  i = d_s;
358  while (i > 0)
359  {
360  fractionalDegrees = fractionalDegrees * 10.0;
361  result += ossimString::toString((int)fractionalDegrees);
362  fractionalDegrees = fractionalDegrees - (int)fractionalDegrees;
363  --i;
364  }
365  theIntDegs = (int)(theDecDegs);
366  }
367  else
368  {
369  theIntDegs = static_cast<int>( std::abs(theDegrees) );
371  ossimString prefix;
372  d_s -= (int)temp.length();
373  while(d_s > 0)
374  {
375  prefix += '0';
376  --d_s;
377  }
378  temp = prefix + temp;
379  result += temp;
380  }
381 // // fill the rest with blanks
382 // ossimString temp = ossimString::toString(theIntDegs);
383 // d_s -= temp.length();
384 // if(d_s>0)
385 // {
386 // if(theAfterDot)
387 // {
388 
389 // while(d_s > 0)
390 // {
391 // temp+='0';
392 // --d_s;
393 // }
394 // }
395 // else
396 // {
397 // ossimString prefix;
398 // while(d_s > 0)
399 // {
400 // prefix += '0';
401 // --d_s;
402 // }
403 // temp = prefix + temp;
404 // }
405 // }
406 
407  break;
408  }
409 
410  case ' ':
411  {
412  result += *stringIter;
413 
414  while (*stringIter == ' ')
415  {
416  result += *stringIter;
417  stringIter++;
418  }
419  break;
420  }
421 
422  case '.':
423  {
424  theAfterDot = true;
425  result += *stringIter++;
426  break;
427  }
428 
429  case 'm':
430  case 'M':
431  case 's':
432  case 'S':
433  {
434  if((*stringIter == 's') ||
435  (*stringIter == 'S'))
436  {
437  theDoingSeconds = true;
438  }
439 
440  calc_mins_or_secs(&theDecDegs, stringIter, result);
441  break;
442  }
443 
444  // This is code that I added so you can do additional
445  // formatting.
446  //
447  case '\'':
448  case '"':
449  {
450  result += *stringIter++;
451  break;
452  }
453  case '@':
454  {
455  result += (char)theDegreeSign;
456  stringIter++;
457  break;
458  }
459  default:
460  {
461  if(theDoingSeconds)
462  {
463  theAfterDot = true;
464  }
465  result += *stringIter++;
466  }
467  } /* end switch statement */
468  } /* end while loop */
469 
470  return result;
471 }
472 
473 // The functions that follow are all dts stuff
474 
476  char format[],
477  bool lat_flag)const
478 {
479  char cdegrees[64];
480  char str_fmt[10];
481  char *rptr, *fptr, *sptr;
482  int i, d_s;
483 
484 /* assign a default format if none is given */
485 
486  if (format[0] == '\0')
487  {
488  set_default(format, cdegrees);
489  }
490  else
491  {
492  memset(cdegrees, ' ', 64);
493 // strcpy(cdegrees, SPACES);
494  }
495 
496  init_values(degrees);
497 
498  rptr = cdegrees;
499  fptr = format;
500  sptr = str_fmt;
501 
502 /* cycle through characters of the format and plug in values */
503 
504  while (*fptr != '\0') {
505 
506  switch (*fptr) {
507 
508  case '-': {
509  (theWorking < 0.0) ? (*rptr = '-') : (*rptr = ' ');
510  rptr++, fptr++;
511  break;
512  }
513 
514  case 'c':
515  case 'C': {
516  if (theWorking < 0.0)
517  (lat_flag == true) ? (*rptr = 'S') : (*rptr = 'W');
518  else
519  (lat_flag == true) ? (*rptr = 'N') : (*rptr = 'E');
520 
521  rptr++, fptr++;
522  break;
523  }
524 
525  case 'd':
526  case 'D': { /* how many 'd's until not 'd' */
527  d_s = 1, fptr++;
528  while (*fptr == 'd') {
529  d_s++, fptr++;
530  }
531  setup_printf(d_s, sptr); /* printf's fmt will be %x.xd */
532 
533  if (theAfterDot == true) { /* beyond the decimal point */
534  i = d_s;
535  while (i-- > 0)
536  theDecDegs = theDecDegs * 10.0;
537 // theIntDegs = (int)(theDecDegs + 0.5);
538  theIntDegs = (int)(theDecDegs);
539  }
540 
541  sprintf(rptr, str_fmt, theIntDegs);
542 
543  if (*rptr == '0' && !theAfterDot) /* remove leading zero */
544  *rptr = ' ';
545  rptr += d_s;
546  break;
547  }
548 
549  case ' ': { /* compress multiple spaces in format */
550  *rptr = *fptr;
551  while (*fptr == ' ')
552  fptr++;
553  rptr++;
554  break;
555  }
556 
557  case '.': {
558  if (theAfterDot == true) { /* a second decimal point? */
559  set_default(format, cdegrees);
560  fptr = format;
561  rptr = cdegrees;
562  init_values(degrees);
563  }
564  else {
565  *rptr = *fptr;
566  rptr++, fptr++;
567  theAfterDot = true;
568  }
569  break;
570  }
571 
572  case 'm':
573  case 'M':
574  case 's':
575  case 'S':
576  {
577  i = calc_mins_or_secs(&theDecDegs, fptr, rptr);
578  fptr += i, rptr += i; /* i == num to advance format */
579  break;
580  }
581 
582  // This is code that I added so you can do additional
583  // formatting.
584  //
585  case '\'':
586  case '"':
587  {
588  *rptr = *fptr;
589  rptr++;
590  fptr++;
591  break;
592  }
593  case '@':
594  {
595  *rptr = (char)theDegreeSign;
596  rptr++;
597  fptr++;
598  break;
599  }
600  default: {
601  set_default(format, cdegrees);
602  fptr = format;
603  rptr = cdegrees;
604  init_values(degrees);
605  }
606  } /* end switch statement */
607 
608  } /* end while loop */
609 
610  *rptr = '\0';
611  return(cdegrees);
612 }
613 
614 
616  std::string::const_iterator& formatIter,
617  std::string& result)const
618 {
619  double du;
620  int ufactor, ires, numunits;
621  char unit;
622 
623  unit = *formatIter; /* set to 'm' or 's' */
624 
625  ufactor = 1, numunits = 0;
626 
627 /* count minutes (or seconds) desired in this part of format */
628 
629  while (*formatIter == unit)
630  {
631  numunits++;
632  formatIter++, ufactor *= 10;
633  }
634 
635 /* different calc based on beyond decimal pt or not */
636 
637  if (theAfterDot == true)
638  {
639  du = *dd * (double)ufactor;
640 // ires = (int)(du + 0.5);
641  ires = (int)(du);
642  *dd = (du - ires);
643  if(*dd < 0.0) *dd = 0.0;
644  }
645  else
646  {
647  du = (*dd * 60.0) * (double)ufactor;
648 // ires = (int)(du + 0.5) / ufactor;
649  ires = (int)(du) / ufactor;
650  *dd = (du - (ires * ufactor)) / (double)ufactor;
651  if(*dd < 0.0) *dd = 0.0;
652  }
653  std::ostringstream out;
654 
655  out << std::setw(numunits)
656  << std::setfill('0')
657  << std::setiosflags(std::ios::right)
658  << std::setprecision(numunits)
659  << ires
660  << std::ends;
661  result+=out.str().c_str();
662 
663 
664 // result += ossimString::toString(ires);
665 }
666 
667 /****************************************************************
668  * integer function calc_mins_or_secs *
669  * calculates minutes from degrees, seconds from minutes, *
670  * based on "format", returning the resultant string *
671  * in "res". "dd" is the part of 'degrees' that provides *
672  * the value to manipulate. the integer returned as the *
673  * value of this function is the number of places in the *
674  * format that have been parsed here, to be used in the *
675  * main function to advance the format-parsing pointer. *
676  ****************************************************************/
677 
678 
680  const char *format,
681  char *res)const
682 {
683  double du;
684  int ufactor, ires, numunits;
685  char unit, str_fmt[8];
686 
687  unit = *format; /* set to 'm' or 's' */
688 
689  ufactor = 1, numunits = 0;
690 
691 /* count minutes (or seconds) desired in this part of format */
692 
693  while (*format == unit) {
694  numunits++;
695  format++, ufactor *= 10;
696  }
697 
698 /* different calc based on beyond decimal pt or not */
699 
700  if (theAfterDot == true) {
701  du = *dd * (double)ufactor;
702 // ires = (int)(du + 0.5);
703  ires = (int)(du + 0.5);
704  *dd = (du - ires);
705  }
706  else {
707  du = (*dd * 60.0) * (double)ufactor;
708 // ires = (int)(du + 0.5) / ufactor;
709  ires = (int)(du) / ufactor;
710  *dd = (du - (ires * ufactor)) / (double)ufactor;
711  }
712  setup_printf(numunits, str_fmt);
713  sprintf(res, str_fmt, ires);
714 
715  return(numunits);
716 }
717 
718 /****************************************************************
719  * function setup_printf *
720  * the C library function sprintf takes as its second *
721  * argument, a format specifier. this function constructs *
722  * that specifier based on 'ival', an integer indicating *
723  * the number of d's or m's or s's seen in the group *
724  * just parsed. *
725  ****************************************************************/
726 
727 void ossimDms::setup_printf(int ival, char *fmt)const
728 {
729  char precis[3];
730 
731  strcpy(fmt, "%");
732  sprintf(precis, "%d", ival);
733  strcat(fmt,precis);
734  strcat(fmt,".");
735  strcat(fmt,precis);
736  strcat(fmt,"d");
737 }
738 
739 /****************************************************************
740  * function set_default *
741  * assigns a default format to be used as the template for *
742  * the conversion of the double precision value, degrees. *
743  * either an error was detected in parsing the format that *
744  * the user entered, or no format was entered at all. *
745  * also, clears the result string of any characters which *
746  * may have been placed therein prior to the call here. *
747  ****************************************************************/
748 
749 
750 void ossimDms::set_default(char *fp, char *rp)const
751 {
752  strcpy(fp, DEFAULT_FORMAT); /* assign default format */
753  strcpy(rp, SPACES);
754 
755 }
756 
757 /****************************************************************
758  * function init_values *
759  * initializes the global values used throughout the *
760  * function. see notes in header file. *
761  ****************************************************************/
762 
763 void ossimDms::init_values(double d)const
764 {
765 
766  theAfterDot = false;
767  theDoingSeconds = false;
768  theSign = 1;
769  if (d < 0.0)
770  theSign = -1;
771 
772  theWorking = d;
773  theIntDegs = (int)theWorking * theSign;
775 
776  return;
777 }
778 
779 
780 /************************************************************************
781  * double function string_to_degree *
782  * *
783  * requires: dts.h *
784  * input: string variable parameter *
785  * returns: double precision number *
786  * *
787  * purpose: to calculate a double precision number, representing *
788  * degrees latitude or longitude, given a string "cdegrees". *
789  * valid input consists of the following characters: *
790  * *
791  * +, -, N, n, S, s, E, e, W, w -- direction indicators *
792  * any digit [0-9] *
793  * a decimal point, '.' -- says decimal degrees follow *
794  * an ascii delimiter, for example ' ', TAB, '/' to *
795  * indicate that either minutes or seconds follow. *
796  * *
797  * output is a double precision number, which will be either *
798  * latitude or longitude degrees and decimal degrees *
799  * *
800  * written as part of the DIAL facility, G&G, WHOI *
801  * April 1992 *
802  * Christine L. Hammond *
803  ************************************************************************/
804 
805 
806 
807 double ossimDms::string_to_degree(const std::string& cdegrees)
808 {
809  if (cdegrees.size() == 0) return 0.0;
810 
811  // We must make a non-const copy of "cdegrees".
812  char* copy = new char[cdegrees.size()+1];
813 
814  //---
815  // Since where going to play with the "copy" pointer we must keep the
816  // original pointer so we can delete it at the bottom.
817  //---
818  char* cptr = copy;
819 
820  strcpy(cptr, cdegrees.c_str());
821 
822  double degrees, factor, dividend, units;
823  int i;
824  bool afterdelim;
825  char c;
826 
827  theAfterDot = false;
828  afterdelim = false;
829  degrees = 0.0;
830  units = 0.0;
831  factor = 1.0;
832  dividend = 60.0;
833  theSign = 1;
834 
835  /* get rid of leading spaces */
836 
837  while (*cptr == ' ')
838  cptr++;
839 
840  while(*cptr != '\0')
841  {
842  switch (*cptr)
843  {
844 
845  /* north, west and + values will change sign of degrees to plus */
846  case '+':
847  case 'n':
848  case 'N':
849  case 'e':
850  case 'E':
851  {
852  if(toupper(*cptr) == 'N')
853  {
854  theLatFlag = true;
855  }
856  else if(toupper(*cptr) == 'E')
857  {
858  theLatFlag = false;
859  }
860  theSign = 1;
861  cptr++;
862  break;
863  }
864 
865  /* south, east and - values will change sign of degrees to minus */
866 
867  case '-':
868  case 's':
869  case 'S':
870  case 'w':
871  case 'W':
872  {
873  if(toupper(*cptr) == 'S')
874  {
875  theLatFlag = true;
876  }
877  else if(toupper(*cptr) == 'W')
878  {
879  theLatFlag = false;
880  }
881  theSign = -1;
882  cptr++;
883  break;
884  }
885 
886  case '0':
887  case '1':
888  case '2':
889  case '3':
890  case '4':
891  case '5':
892  case '6':
893  case '7':
894  case '8':
895  case '9':
896  {
897  c = *cptr;
898  i = (c - '0');
899 
900  if (afterdelim == true) {
901 
902  if (theAfterDot == true)
903  units = units + (((double)i * factor) / dividend);
904  else
905  units = (units * factor) + ((double)i / dividend);
906  }
907  else {
908 
909  if (theAfterDot == true)
910  degrees = degrees + ((double)i * factor);
911  else
912  degrees = (degrees * factor) + (double)i;
913  }
914 
915  if (theAfterDot == true)
916  factor = factor * .10;
917  else
918  factor = 10.;
919 
920  cptr++;
921  break;
922  }
923 
924  /* a decimal point indicates a change in the factor used */
925  /* to calculate degrees or units (minutes or seconds) */
926 
927  case '.':
928  {
929  factor = .10;
930  theAfterDot = true;
931  cptr++;
932  break;
933  }
934 
935  /* after a delimiter the value contains minutes, first time through */
936 
937  case ' ':
938  {
939 
940  while (*(cptr + 1) == ' ')
941  cptr++;
942 
943  degrees = degrees + units;
944  units = 0.0;
945 
946  if (afterdelim == true) /* must be seconds */
947  dividend = dividend * dividend;
948  else
949  afterdelim = true;
950 
951  factor = 1.;
952 
953  cptr++;
954 
955  /* skip any leading zeroes after delimiter */
956 
957  while (*cptr == '0')
958  cptr++;
959 
960  break;
961  }
962 
963  /* check for a delimiter that is allowable:
964  isspace allows: space, tab, cr, nl, vt, ff
965  ispunct allows: punctuation char != space or control or letter */
966 
967  default:
968  {
969  if (isspace(*cptr) || ispunct(*cptr))
970  *cptr = ' ';
971  }
972 
973  } /* end switch */
974 
975  } /* end while loop */
976 
977  /* add any units that may have been calculated (minutes or seconds) */
978 
979  degrees = degrees + units;
980 
981  //---
982  // NOTE: local variable "cptr" has been moved so do not delete "cptr"
983  // delete "copy" which points to the original allocated memory...
984  //---
985  delete [] copy;
986  copy = 0;
987 
988  return(degrees * (double)theSign);
989 }
int theIntDegs
Definition: ossimDms.h:105
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35
bool theAfterDot
Definition: ossimDms.h:103
double theDegrees
Definition: ossimDms.h:96
static ossimString toString(bool aValue)
Numeric to string methods.
void calc_mins_or_secs(double *dd, std::string::const_iterator &formatIter, std::string &result) const
Definition: ossimDms.cpp:615
ossimDms()
Default constructor.
Definition: ossimDms.cpp:27
#define abs(a)
Definition: auxiliary.h:74
void set_default(char *fp, char *rp) const
function set_default * assigns a default format to be used as the template for the conversion of th...
Definition: ossimDms.cpp:750
std::string::iterator end()
Definition: ossimString.h:423
void init_values(double d) const
function init_values initializes the global values used throughout the function.
Definition: ossimDms.cpp:763
static const char * DEFAULT_FORMAT
Definition: ossimDms.h:93
std::string::size_type length() const
Definition: ossimString.h:408
std::string::iterator begin()
Definition: ossimString.h:420
bool setDegrees(const std::string &value)
setDegrees(char*).
Definition: ossimDms.cpp:79
double theWorking
Definition: ossimDms.h:107
return status
static const char * SPACES
Definition: ossimDms.h:94
bool theLatFlag
Definition: ossimDms.h:97
ossimString degree_to_string(double degrees, char format[], bool lat_flag) const
char * function degree_to_string
Definition: ossimDms.cpp:475
double theDecDegs
Definition: ossimDms.h:102
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
static const ossim_uint8 theDegreeSign
Definition: ossimDms.h:90
double string_to_degree(const std::string &cdegrees)
double function string_to_degree
Definition: ossimDms.cpp:807
int theSign
Definition: ossimDms.h:106
void setup_printf(int ival, char *fmt) const
function setup_printf the C library function sprintf takes as its second argument, a format specifier.
Definition: ossimDms.cpp:727
unsigned char ossim_uint8
bool theDoingSeconds
Definition: ossimDms.h:104
ossimString toString(const ossimString &formatString=ossimString("")) const
You can specify a number of different formats.
Definition: ossimDms.cpp:294