OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimNadconNarDatum.cpp
Go to the documentation of this file.
2 
3 RTTI_DEF1(ossimNadconNarDatum, "ossimNadconNarDatum", ossimNadconGridDatum);
5  :
6  ossimNadconGridDatum(nadconDirectory,
7  ossimString("NAR"),
8  ossimString("NORTH AMERICAN 1983 NADCON, CONUS GRID"),
9  ossimEllipsoidFactory::instance()->create(ossimString("RF")),
10  2.000000000000000, 2.000000000000000, 2.000000000000000,
11  -135.0, -60.0, 15.0, 60.0,
12  0.000000000000000, 0.000000000000000, 0.000000000000000)
13 {
14 }
15 
17 {
18  const ossimDatum* datum = aPt.datum();
19  ossimString code = datum->code();
20  ossimString subCode(code.begin(),
21  code.begin() + 3);
22  if(subCode == "NAR")
23  {
24  return aPt;
25  }
26  else
27  {
28  if(subCode == "NAS")
29  {
30  checkGrid(aPt);
33  {
34  return ossimThreeParamDatum::shift(aPt);
35  }
36 
37  double shiftLat = theLatGrid.getShiftAtLatLon(aPt.latd(), aPt.lond());
38  double shiftLon = theLonGrid.getShiftAtLatLon(aPt.latd(), aPt.lond());
39 
40  if( (ossim::isnan(shiftLat)) || (ossim::isnan(shiftLon)) )
41  {
42  return ossimThreeParamDatum::shift(aPt);
43  }
44  else
45  {
46  // Note the shifts are stored in the file
47  // as seconds.
48  //
49  // convert the seconds into decimal degrees.
50  //
51  shiftLat /= 3600.0;
52  shiftLon /= 3600.0;
53  return ossimGpt(aPt.latd() + shiftLat,
54  aPt.lond() - shiftLon,
55  aPt.height(),
56  this);
57  }
58  }
59  else
60  {
61  return ossimThreeParamDatum::shift(aPt);
62  }
63  }
64 
65  return ossimThreeParamDatum::shift(aPt);
66 }
double lond() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:97
virtual const ossimString & code() const
Definition: ossimDatum.h:57
void checkGrid(const ossimDpt &latLon) const
ossimNadconGridFile theLatGrid
double latd() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:87
const ossimDatum * datum() const
datum().
Definition: ossimGpt.h:196
std::string::iterator begin()
Definition: ossimString.h:420
double height() const
Definition: ossimGpt.h:107
virtual ossimGpt shift(const ossimGpt &aPt) const
RTTI_DEF1(ossimNadconNarDatum, "ossimNadconNarDatum", ossimNadconGridDatum)
virtual ossimGpt shift(const ossimGpt &aPt) const
double getShiftAtLatLon(double lat, double lon) const
ossimNadconGridFile theLonGrid
ossimNadconNarDatum(const ossimFilename &nadconDirectory)
bool isnan(const float &v)
isnan Test for floating point Not A Number (NAN) value.
Definition: ossimCommon.h:91