33 #include <ossim/base/ossimTrace.h> 34 static ossimTrace traceExec (
"ossimElevSource:exec");
35 static ossimTrace traceDebug (
"ossimElevSource:debug");
38 static const char ENABLE_STATS_KW[] =
"elevation.compute_statistics.enabled";
42 theMinHeightAboveMSL (0.0),
43 theMaxHeightAboveMSL (0.0),
47 theComputeStatsFlag(false)
53 <<
"DEBUG ossimElevSource::ossimElevSource: entering..." 69 <<
"\ntheComputeStatsFlag: " 78 <<
"DEBUG ossimElevSource::ossimElevSource: returning..." 85 theMinHeightAboveMSL(src.theMinHeightAboveMSL),
86 theMaxHeightAboveMSL(src.theMaxHeightAboveMSL),
87 theNullHeightValue(src.theNullHeightValue),
88 theSeaLevelValue(src.theSeaLevelValue),
89 theGroundRect(src.theGroundRect),
90 theComputeStatsFlag(src.theComputeStatsFlag)
100 <<
"FATAL ossimElevSource::getHeightAboveEllipsoid Not implemented..." 126 static const double CONVERGENCE_THRESHOLD = 0.001;
127 static const int MAX_NUM_ITERATIONS = 50;
135 int iteration_count = 0;
158 gpt =
ossimGpt(prev_intersect_pt, datum);
169 if (
ossim::isnan(h_ellips) ) h_ellips = defaultElevValue;
189 gpt =
ossimGpt(new_intersect_pt, datum);
194 distance = (new_intersect_pt - prev_intersect_pt).magnitude();
195 if (
distance < CONVERGENCE_THRESHOLD)
199 prev_intersect_pt = new_intersect_pt;
205 }
while ((!done) && (iteration_count < MAX_NUM_ITERATIONS));
207 if (iteration_count == MAX_NUM_ITERATIONS)
212 <<
"point. Result is probably inaccurate." << std::endl;
double getSeaLevelValue() const
virtual ~ossimElevSource()
double theNullHeightValue
bool intersectRay(const ossimEcefRay &ray, ossimGpt &gpt, double defaultElevValue=0.0)
METHOD: intersectRay()
double theMinHeightAboveMSL
Data members:
double nan()
Method to return ieee floating point double precision NAN.
This code was derived from https://gist.github.com/mshockwave.
const ossimEcefPoint & origin() const
#define OSSIM_DEFAULT_MEAN_SEA_LEVEL
virtual bool getComputeStatisticsFlag() const
Opens a stream to an elevation cell.
virtual void setComputeStatisticsFlag(bool flag)
Sets the flag which controls whether or not statistics will be computed upon opening a cell and not f...
virtual std::ostream & print(std::ostream &out) const
Outputs theErrorStatus as an ossimErrorCode and an ossimString.
const ossimDatum * datum() const
datum().
virtual const ossimGrect & getBoundingGndRect() const
METHODS: accuracyLE90(), accuracyCE90() Returns the vertical and horizontal accuracy (90% confidence)...
virtual std::ostream & print(std::ostream &out) const
Outputs theErrorStatus as an ossimErrorCode and an ossimString.
ossimElevSource()
Constructors/Destructors:
const char * findPreference(const char *key) const
bool toBool() const
String to numeric methods.
unsigned long long ossim_uint64
virtual const ossimEllipsoid * ellipsoid() const
static ossimPreferences * instance()
virtual double getMinHeightAboveMSL() const
Access methods for the bounding elevations:
virtual bool canConnectMyInputTo(ossim_int32 inputIndex, const ossimConnectableObject *object) const
required to be overriden by derived classes
virtual double getMaxHeightAboveMSL() const
double getNullHeightValue() const
Special numeric quantities as defined by this source:
double theMaxHeightAboveMSL
virtual void initialize()
Implement ossimSource base-class pure virtuals:
#define RTTI_DEF1(cls, name, b1)
virtual double getHeightAboveEllipsoid(const ossimGpt &)
float distance(double lat1, double lon1, double lat2, double lon2, int units)
bool nearestIntersection(const ossimEcefRay &ray, ossimEcefPoint &rtnPt) const
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
std::basic_ostream< char > ostream
Base class for char output streams.
bool isnan(const float &v)
isnan Test for floating point Not A Number (NAN) value.