OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Functions | Variables
ossimTieGpt.cpp File Reference
#include <iostream>
#include <iomanip>
#include <ossim/base/ossimTieGpt.h>
#include <ossim/base/ossimString.h>
#include <ossim/base/ossimDatum.h>
#include <ossim/base/ossimNotifyContext.h>

Go to the source code of this file.

Functions

std::ostream & operator<< (std::ostream &os, const ossimTieGpt &pt)
 
std::istream & operator>> (std::istream &is, ossimTieGpt &pt)
 

Variables

const char * GROUND_GML2 = "ground/gml:Point"
 
const char * IMAGE_GML2 = "image/gml:Point"
 
const char * SCORE_GML2 = "score"
 
const char * COORD_GML2 = "gml:coord"
 
const char * COORDINATES_GML2 = "gml:coordinates"
 

Function Documentation

◆ operator<<()

std::ostream& operator<< ( std::ostream &  os,
const ossimTieGpt pt 
)

Definition at line 43 of file ossimTieGpt.cpp.

References ossimTieGpt::print().

44 {
45  return pt.print(os);
46 }
std::ostream & print(std::ostream &os) const
text serialization
Definition: ossimTieGpt.cpp:11

◆ operator>>()

std::istream& operator>> ( std::istream &  is,
ossimTieGpt pt 
)

Expected format: ( ( ossimGpt ), ( ossimDpt ), 0.50000000000000 ) –*this-— , -—tie--—, —score-----—

Definition at line 48 of file ossimTieGpt.cpp.

References ossimTieGpt::makeNan(), ossim::nan(), ossimTieGpt::score, and ossimTieGpt::tie.

49 {
50  //---
51  // Expected input format:
52  // ( (ossimDPt), (ossimDpt), score )
53  // score is real or nan
54  //---
55 
56  // Start with a nan point.
57  pt.makeNan();
58  // Check the stream.
59  if (!is) return is;
60 
61  ossimString tempString;
62 
63  // Gobble the "(".
64  is >> tempString;
65 
66  //get the first point
67  is>>dynamic_cast<ossimGpt&>(pt);
68 
69  // Eat the ",".
70  char c;
71  is.get(c);
72 
73  //get the second point
74  is>>pt.tie;
75 
76  // Eat the second ",".
77  is.get(c);
78 
79  // Get the score
80  const int SZ = 64; // real number buffer size
81  char tempChars[SZ];
82  is.get(tempChars, SZ, ',');
83  if (!is) return is;
84  tempChars[SZ-1] = '\0';
85  tempString = tempChars;
86  tempString.trim();
87  if (tempString == "nan")
88  {
89  pt.score = ossim::nan();
90  }
91  else
92  {
93  pt.score = tempString.toDouble();
94  }
95 
96  // Gobble the trailing ")".
97  is >> tempString;
98 
99  // Finished
100  return is;
101 }
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
void makeNan()
Definition: ossimTieGpt.h:66
ossimDpt tie
Public data members.
Definition: ossimTieGpt.h:108
ossim_float64 score
Definition: ossimTieGpt.h:109

Variable Documentation

◆ COORD_GML2

const char* COORD_GML2 = "gml:coord"

◆ COORDINATES_GML2

const char* COORDINATES_GML2 = "gml:coordinates"

Definition at line 108 of file ossimTieGpt.cpp.

◆ GROUND_GML2

const char* GROUND_GML2 = "ground/gml:Point"

◆ IMAGE_GML2

const char* IMAGE_GML2 = "image/gml:Point"

◆ SCORE_GML2

const char* SCORE_GML2 = "score"