OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ossimElevSource Class Referenceabstract

#include <ossimElevSource.h>

Inheritance diagram for ossimElevSource:
ossimSource ossimConnectableObject ossimErrorStatusInterface ossimObject ossimListenerManager ossimPropertyInterface ossimReferenced ossimElevationDatabase ossimElevCellHandler ossimElevManager ossimElevationCellDatabase ossimTiledElevationDatabase ossimDtedHandler ossimGeneralRasterElevHandler ossimImageElevationHandler ossimSrtmHandler ossimDtedElevationDatabase ossimGeneralRasterElevationDatabase ossimImageElevationDatabase ossimSrtmElevationDatabase

Public Member Functions

virtual double getHeightAboveMSL (const ossimGpt &)=0
 Height access methods: More...
 
virtual double getHeightAboveEllipsoid (const ossimGpt &)
 
virtual ossimObjectdup () const =0
 
bool intersectRay (const ossimEcefRay &ray, ossimGpt &gpt, double defaultElevValue=0.0)
 METHOD: intersectRay() More...
 
virtual double getMinHeightAboveMSL () const
 Access methods for the bounding elevations: More...
 
virtual double getMaxHeightAboveMSL () const
 
double getNullHeightValue () const
 Special numeric quantities as defined by this source: More...
 
double getSeaLevelValue () const
 
virtual bool pointHasCoverage (const ossimGpt &) const =0
 METHOD: pointHasCoverage(gpt) Returns TRUE if coverage exists over gpt: More...
 
virtual double getMeanSpacingMeters () const =0
 METHOD: meanSpacingMeters() This method returns the post spacing in the region of gpt: More...
 
virtual bool getAccuracyInfo (ossimElevationAccuracyInfo &info, const ossimGpt &gpt) const =0
 
virtual const ossimGrectgetBoundingGndRect () const
 METHODS: accuracyLE90(), accuracyCE90() Returns the vertical and horizontal accuracy (90% confidence) in the region of gpt: More...
 
virtual bool canConnectMyInputTo (ossim_int32 inputIndex, const ossimConnectableObject *object) const
 required to be overriden by derived classes More...
 
virtual void initialize ()
 Implement ossimSource base-class pure virtuals: More...
 
virtual bool getComputeStatisticsFlag () const
 Opens a stream to an elevation cell. More...
 
virtual void setComputeStatisticsFlag (bool flag)
 Sets the flag which controls whether or not statistics will be computed upon opening a cell and not finding a corresponding statistics file. More...
 
virtual std::ostream & print (std::ostream &out) const
 Outputs theErrorStatus as an ossimErrorCode and an ossimString. More...
 
- Public Member Functions inherited from ossimSource
 ossimSource (ossimObject *owner=0)
 
 ossimSource (ossimObject *owner, ossim_uint32 inputListSize, ossim_uint32 outputListSize, bool inputListIsFixedFlag=true, bool outputListIsFixedFlag=true)
 
virtual ~ossimSource ()
 
virtual bool isSourceEnabled () const
 
virtual void enableSource ()
 
virtual void disableSource ()
 
virtual bool getEnableFlag () const
 
virtual void setEnableFlag (bool flag)
 
virtual bool isInitialized () const
 
virtual void setInitializedFlag (bool flag)
 
virtual void setProperty (ossimRefPtr< ossimProperty > property)
 
virtual ossimRefPtr< ossimPropertygetProperty (const ossimString &name) const
 
virtual void getPropertyNames (std::vector< ossimString > &propertyNames) const
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 
- Public Member Functions inherited from ossimConnectableObject
 ossimConnectableObject (ossimObject *owner=0)
 Base constructor of this object. More...
 
 ossimConnectableObject (ossimObject *owner, ossim_int32 inputListSize, ossim_int32 outputListSize, bool inputListIsFixedFlag=true, bool outputListIsFixedFlag=true)
 
virtual ~ossimConnectableObject ()
 
void setId (const ossimId &id)
 All connectable objects will have id's. More...
 
const ossimIdgetId () const
 Will allow us to get this object's id. More...
 
const ossimObjectgetOwner () const
 Fetches the current owner, most likely a container but not limited to one. More...
 
virtual void changeOwner (ossimObject *owner)
 Permits changing the object's owner. More...
 
virtual void setDescription (const ossimString &description)
 
virtual ossimString getDescription () const
 
virtual bool isConnected (ossimConnectableObjectDirectionType direction=CONNECTABLE_DIRECTION_INPUT) const
 will check the direction specified to see if all slots are full. More...
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findConnectableObject(const ossimId &id))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findObjectOfType(RTTItypeid typeId, ossimConnectableObjectDirectionType directionType, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findObjectOfType(const ossimString &obj, ossimConnectableObjectDirectionType directionType, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findInputObjectOfType(const ossimString &className))
 
virtual ossim_int32 findInputIndex (const ossimConnectableObject *object)
 Return a valid index of the input list if the passed in object is found else return -1. More...
 
virtual ossim_int32 findInputIndex (const ossimId &id)
 Return a valid index of the input list if the passed id is found else return -1. More...
 
virtual ossim_int32 findOutputIndex (const ossimConnectableObject *object)
 Return a valid index of the output list if the passed in object is found else return -1. More...
 
virtual ossim_int32 findOutputIndex (const ossimId &id)
 Return a valid index of the output list if the passed in object is found else return -1. More...
 
virtual ossim_int32 getMyInputIndexToConnectTo (ossimConnectableObject *object) const
 Should return the first available index to connect to. More...
 
virtual ossim_int32 getMyOutputIndexToConnectTo (ossimConnectableObject *object) const
 Should return the first available index to connect to. More...
 
virtual bool canConnectMyOutputTo (ossim_int32 myOutputIndex, const ossimConnectableObject *object) const
 default implementation is to allow anyone to connect to us. More...
 
virtual void disconnect (ossimConnectableObject *object=0)
 Will disconnect the object passed in. More...
 
virtual void disconnect (const ossimId &id)
 Will disconnect the object passed in. More...
 
virtual ossimRefPtr< ossimConnectableObjectdisconnectMyInput (ossim_int32 inputIndex, bool disconnectOutputFlag=true, bool createEventFlag=true)
 Will disconnect the object at the given input index and generate a connection event. More...
 
virtual void disconnectMyInput (ossimConnectableObject *input, bool disconnectOutputFlag=true, bool createEventFlag=true)
 Finds the index of the passed in input and calls disconnectMyInput(inputIndex, disconnectOutputFlag, createEventFlag);. More...
 
virtual void disconnectMyInputs (ConnectableObjectList &inputList, bool disconnectOutputFlag=true, bool createEventFlag=true)
 
virtual ossimRefPtr< ossimConnectableObjectdisconnectMyOutput (ossim_int32 outputIndex, bool disconnectInputFlag=true, bool createEventFlag=true)
 Will disconnect the object at the given output index and generate a connection event. More...
 
virtual void disconnectMyOutput (ossimConnectableObject *output, bool disconnectInputFlag=true, bool createEventFlag=true)
 Will disconnect the output object. More...
 
virtual void disconnectMyOutputs (ConnectableObjectList &outputList, bool disconnectOutputFlag=true, bool createEventFlag=true)
 
virtual void disconnectAllInputs ()
 Will disconnect all of the input objects. More...
 
virtual void disconnectAllOutputs ()
 Will disconnect all of the output objects. More...
 
virtual ossim_int32 connectMyInputTo (ossimConnectableObject *inputObject, bool makeOutputConnection=true, bool createEventFlag=true)
 Will try to connect this objects input to the passed in object. More...
 
virtual ossim_int32 connectMyInputTo (ossim_int32 inputIndex, ossimConnectableObject *inputObject, bool makeOutputConnection=true, bool createEventFlag=true)
 Will connect the specified input to the passed in object. More...
 
virtual bool connectMyInputTo (ConnectableObjectList &inputList, bool makeOutputConnection=true, bool createEventFlag=true)
 
virtual ossim_int32 connectMyOutputTo (ossimConnectableObject *outputObject, bool makeInputConnection=true, bool createEventFlag=true)
 Will try to connect this objects output to the passed in object. More...
 
virtual bool connectMyOutputTo (ConnectableObjectList &outputList, bool makeInputConnection=true, bool createEventFlag=true)
 
virtual bool connectInputList (ConnectableObjectList &inputList)
 Will disconnect itself from all inputs and reset to the passed in input list. More...
 
virtual bool connectOutputList (ConnectableObjectList &outputList)
 Will disconnect itself from all outputs and reset to the passed in output list. More...
 
virtual ossim_uint32 getNumberOfInputs () const
 Returns the number of input objects. More...
 
virtual ossim_uint32 getNumberOfOutputs () const
 Return the number of output objects. More...
 
ossimConnectableObjectgetInput (ossim_uint32 index=0)
 returns the object at the specified index. More...
 
const ossimConnectableObjectgetInput (ossim_uint32 index=0) const
 returns the object at the specified index. More...
 
ossimConnectableObjectgetOutput (ossim_uint32 index=0)
 returns the object at the specified index. More...
 
const ossimConnectableObjectgetOutput (ossim_uint32 index=0) const
 returns the object at the specified index. More...
 
virtual void setNumberOfInputs (ossim_int32 numberOfInputs)
 Will set the number of inputs. More...
 
virtual bool getInputListIsFixedFlag () const
 
virtual bool getOutputListIsFixedFlag () const
 
virtual void setNumberOfOutputs (ossim_int32 numberOfInputs)
 Will set the number of outputs. More...
 
const ConnectableObjectListgetInputList () const
 
const ConnectableObjectListgetOutputList () const
 
ConnectableObjectListgetInputList ()
 
ConnectableObjectListgetOutputList ()
 
 OSSIM_DEPRECATE_METHOD (virtual void findAllObjectsOfType(ConnectableObjectList &result, const RTTItypeid &typeInfo, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual void findAllObjectsOfType(ConnectableObjectList &result, const ossimString &className, bool recurse=true))
 
virtual void propagateEventToOutputs (ossimEvent &event)
 
virtual void propagateEventToInputs (ossimEvent &event)
 
virtual void setProperty (const ossimString &name, const ossimString &value)
 
virtual ossim_uint32 saveStateOfAllInputs (ossimKeywordlist &kwl, bool saveThisStateFlag=true, ossim_uint32 objectIndex=1, const char *prefix=0) const
 Save the state of all inputs to a keyword list. More...
 
virtual bool fillContainer (ossimConnectableContainer &container)
 Inserts this object and all of its children and inputs into the container provided. More...
 
bool moveInputUp (const ossimId &id)
 Moves the input connection matching id up one in the connection list. More...
 
bool moveInputDown (const ossimId &id)
 Moves the input connection matching id down one in the connection list. More...
 
bool moveInputToTop (const ossimId &id)
 Moves the input connection matching id to the top of the connection list. More...
 
bool moveInputToBottom (const ossimId &id)
 Moves the input connection matching id to the bottom of the connection list. More...
 
virtual void accept (ossimVisitor &visitor)
 We will add a visitor interface for all connectable objects. More...
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
virtual ossimString getShortName () const
 
virtual ossimString getLongName () const
 
virtual ossimString getClassName () const
 
virtual RTTItypeid getType () const
 
virtual bool canCastTo (ossimObject *obj) const
 
virtual bool canCastTo (const RTTItypeid &id) const
 
virtual bool canCastTo (const ossimString &parentClassName) const
 
virtual bool isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
 
- Public Member Functions inherited from ossimReferenced
 ossimReferenced ()
 
 ossimReferenced (const ossimReferenced &)
 
ossimReferencedoperator= (const ossimReferenced &)
 
void ref () const
 increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unref () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unref_nodelete () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
int referenceCount () const
 
- Public Member Functions inherited from ossimListenerManager
 ossimListenerManager ()
 
virtual ~ossimListenerManager ()
 
virtual void fireEvent (ossimEvent &event)
 
virtual bool addListener (ossimListener *listener)
 
virtual bool removeListener (ossimListener *listener)
 
virtual bool findListener (ossimListener *listener)
 
- Public Member Functions inherited from ossimPropertyInterface
 ossimPropertyInterface ()
 
virtual ~ossimPropertyInterface ()
 
virtual ossimString getPropertyValueAsString (const ossimString &name) const
 
void getPropertyList (std::vector< ossimRefPtr< ossimProperty > > &propertyList) const
 
void setProperties (std::vector< ossimRefPtr< ossimProperty > > &propertyList)
 
- Public Member Functions inherited from ossimErrorStatusInterface
 ossimErrorStatusInterface ()
 
virtual ~ossimErrorStatusInterface ()
 
virtual ossimErrorCode getErrorStatus () const
 
virtual ossimString getErrorStatusString () const
 
virtual void setErrorStatus (ossimErrorCode error_status) const
 
virtual void setErrorStatus () const
 
virtual void clearErrorStatus () const
 
bool hasError () const
 

Protected Member Functions

virtual ~ossimElevSource ()
 
 ossimElevSource ()
 Constructors/Destructors: More...
 
 ossimElevSource (const ossimElevSource &src)
 
- Protected Member Functions inherited from ossimSource
 ossimSource (const ossimSource &rhs)
 
const ossimSourceoperator= (const ossimSource &rhs)
 
- Protected Member Functions inherited from ossimConnectableObject
ossimConnectableObjectfindObjectOfType (ConnectableObjectList *connectableList, ossimVisitor &visitor)
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 
- Protected Member Functions inherited from ossimListenerManager
 ossimListenerManager (const ossimListenerManager &rhs)
 

Protected Attributes

double theMinHeightAboveMSL
 Data members: More...
 
double theMaxHeightAboveMSL
 
double theNullHeightValue
 
double theSeaLevelValue
 
ossimGrect theGroundRect
 
bool theComputeStatsFlag
 
- Protected Attributes inherited from ossimSource
bool theEnableFlag
 
bool theInitializedFlag
 
- Protected Attributes inherited from ossimConnectableObject
ossimId theId
 
ossimString theDescription
 
ossimObjecttheOwner
 
bool theInputListIsFixedFlag
 Indicates whether the theInputObjectList is fixed. More...
 
bool theOutputListIsFixedFlag
 Indicates whether the theOutputObjectList is fixed. More...
 
ConnectableObjectList theInputObjectList
 Holds a list of input objects. More...
 
ConnectableObjectList theOutputObjectList
 Holds a list of output objects. More...
 
- Protected Attributes inherited from ossimListenerManager
std::list< ossimListener * > theListenerList
 
bool theEnabledFlag
 
std::list< ossimListener * > theDelayedAdd
 
std::list< ossimListener * > theDelayedRemove
 
bool theFireEventFlag
 
- Protected Attributes inherited from ossimErrorStatusInterface
ossimErrorCode theErrorStatus
 

Additional Inherited Members

- Public Types inherited from ossimConnectableObject
enum  ossimConnectableObjectDirectionType { CONNECTABLE_DIRECTION_NONE = 0, CONNECTABLE_DIRECTION_INPUT = 1, CONNECTABLE_DIRECTION_OUTPUT = 2 }
 
typedef std::vector< ossimRefPtr< ossimConnectableObject > > ConnectableObjectList
 

Detailed Description

Definition at line 31 of file ossimElevSource.h.

Constructor & Destructor Documentation

◆ ~ossimElevSource()

ossimElevSource::~ossimElevSource ( )
protectedvirtual

Definition at line 94 of file ossimElevSource.cpp.

95 {}

◆ ossimElevSource() [1/2]

ossimElevSource::ossimElevSource ( )
protected

Constructors/Destructors:

Definition at line 40 of file ossimElevSource.cpp.

41  :
46  theGroundRect(),
47  theComputeStatsFlag(false)
48 
49 {
50  if (traceExec())
51  {
53  << "DEBUG ossimElevSource::ossimElevSource: entering..."
54  << std::endl;
55  }
56 
57  // User can turn on off with a keyword.
58  const char* lookup =
59  ossimPreferences::instance()->findPreference(ENABLE_STATS_KW);
60  if (lookup)
61  {
63  }
64 
65  if (traceDebug())
66  {
68  << "DEBUG:"
69  << "\ntheComputeStatsFlag: "
70  << (theComputeStatsFlag?"true":"false")
71  << endl;
72  }
73 
74 
75  if (traceExec())
76  {
78  << "DEBUG ossimElevSource::ossimElevSource: returning..."
79  << std::endl;
80  }
81 }
double theMinHeightAboveMSL
Data members:
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
#define OSSIM_DEFAULT_MEAN_SEA_LEVEL
ossimGrect theGroundRect
const char * findPreference(const char *key) const
bool toBool() const
String to numeric methods.
static ossimPreferences * instance()
double theMaxHeightAboveMSL
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ ossimElevSource() [2/2]

ossimElevSource::ossimElevSource ( const ossimElevSource src)
protected

Definition at line 83 of file ossimElevSource.cpp.

Member Function Documentation

◆ canConnectMyInputTo()

bool ossimElevSource::canConnectMyInputTo ( ossim_int32  myInputIndex,
const ossimConnectableObject object 
) const
virtual

required to be overriden by derived classes

Implements ossimConnectableObject.

Reimplemented in ossimElevCellHandler.

Definition at line 245 of file ossimElevSource.cpp.

247 {
248  return false;
249 }

◆ dup()

virtual ossimObject* ossimElevSource::dup ( ) const
pure virtual

◆ getAccuracyInfo()

virtual bool ossimElevSource::getAccuracyInfo ( ossimElevationAccuracyInfo info,
const ossimGpt gpt 
) const
pure virtual

◆ getBoundingGndRect()

const ossimGrect & ossimElevSource::getBoundingGndRect ( ) const
virtual

METHODS: accuracyLE90(), accuracyCE90() Returns the vertical and horizontal accuracy (90% confidence) in the region of gpt:

METHOD: getBoundingGndRect

Returns
The bounding geograpic rectangle in decimal degrees.

Definition at line 240 of file ossimElevSource.cpp.

References theGroundRect.

Referenced by ossimImageElevationDatabase::createCell(), and ossimImageElevationDatabase::getBoundingRect().

241 {
242  return theGroundRect;
243 }
ossimGrect theGroundRect

◆ getComputeStatisticsFlag()

bool ossimElevSource::getComputeStatisticsFlag ( ) const
virtual

Opens a stream to an elevation cell.

Returns
Returns true on success, false on error.
Note
This implementation always returns true. This should be overridden in derived classes that have streams to files. Closes the stream to the file.
This implementation does nothing. This should be overridden in derived classes that have streams to files.
Returns
Returns the flag which controls whether or not statistics will be computed upon opening a cell and not finding a corresponding statistics file.

Definition at line 255 of file ossimElevSource.cpp.

References theComputeStatsFlag.

256 {
257  return theComputeStatsFlag;
258 }

◆ getHeightAboveEllipsoid()

double ossimElevSource::getHeightAboveEllipsoid ( const ossimGpt )
virtual

Reimplemented in ossimTiledElevationDatabase, ossimImageElevationDatabase, ossimGeneralRasterElevationDatabase, ossimElevManager, ossimDtedElevationDatabase, and ossimSrtmElevationDatabase.

Definition at line 97 of file ossimElevSource.cpp.

References ossimNotify(), ossimNotifyLevel_FATAL, and theNullHeightValue.

98 {
100  << "FATAL ossimElevSource::getHeightAboveEllipsoid Not implemented..."
101  << std::endl;
102  return theNullHeightValue;
103 }
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ getHeightAboveMSL()

virtual double ossimElevSource::getHeightAboveMSL ( const ossimGpt )
pure virtual

◆ getMaxHeightAboveMSL()

double ossimElevSource::getMaxHeightAboveMSL ( ) const
virtual

Definition at line 225 of file ossimElevSource.cpp.

References theMaxHeightAboveMSL.

Referenced by ossimElevImageSource::getMaxPixelValue(), and ossimElevImageSource::getTile().

226 {
227  return theMaxHeightAboveMSL;
228 }
double theMaxHeightAboveMSL

◆ getMeanSpacingMeters()

virtual double ossimElevSource::getMeanSpacingMeters ( ) const
pure virtual

METHOD: meanSpacingMeters() This method returns the post spacing in the region of gpt:

Implemented in ossimElevManager, ossimElevCellHandler, and ossimElevationDatabase.

Referenced by ossimElevLess::operator()().

◆ getMinHeightAboveMSL()

double ossimElevSource::getMinHeightAboveMSL ( ) const
virtual

Access methods for the bounding elevations:

Definition at line 220 of file ossimElevSource.cpp.

References theMinHeightAboveMSL.

Referenced by ossimElevImageSource::getMinPixelValue(), and ossimElevImageSource::getTile().

221 {
222  return theMinHeightAboveMSL;
223 }
double theMinHeightAboveMSL
Data members:

◆ getNullHeightValue()

double ossimElevSource::getNullHeightValue ( ) const

Special numeric quantities as defined by this source:

Definition at line 230 of file ossimElevSource.cpp.

References theNullHeightValue.

231 {
232  return theNullHeightValue;
233 }

◆ getSeaLevelValue()

double ossimElevSource::getSeaLevelValue ( ) const

Definition at line 235 of file ossimElevSource.cpp.

References theSeaLevelValue.

236 {
237  return theSeaLevelValue;
238 }

◆ initialize()

void ossimElevSource::initialize ( )
virtual

Implement ossimSource base-class pure virtuals:

Reimplemented from ossimSource.

Definition at line 251 of file ossimElevSource.cpp.

252 {}

◆ intersectRay()

bool ossimElevSource::intersectRay ( const ossimEcefRay ray,
ossimGpt gpt,
double  defaultElevValue = 0.0 
)

METHOD: intersectRay()

Service method for intersecting a ray with the elevation surface to arrive at a ground point. The ray is expected to originate ABOVE the surface and pointing down.

NOTE: the gpt argument is expected to be initialized with the desired datum, including ellipsoid, for the proper intersection point to be computed.

LIMITATION: This release supports only single valued solutions, i.e., it is possible a ray passing through one side of a mountain and out the other will return an intersection with the far side. Eventually, a more robust algorithm will be employed.

Returns true if good intersection found.

Definition at line 122 of file ossimElevSource.cpp.

Referenced by ossimSkyBoxLearSensor::lineSampeToWorld(), ossimPpjFrameSensor::lineSampleToWorld(), ossimRsmModel::lineSampleToWorld(), ossimSonomaSensor::lineSampleToWorld(), ossimRpcModel::lineSampleToWorld(), and ossimAlphaSensor::lineSampToWorld().

123 {
124  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimElevSource::intersectRay: entering..." << std::endl;
125 
126  static const double CONVERGENCE_THRESHOLD = 0.001; // meters
127  static const int MAX_NUM_ITERATIONS = 50;
128 
129  double h_ellips; // height above ellipsoid
130  bool intersected;
131  ossimEcefPoint prev_intersect_pt (ray.origin());
132  ossimEcefPoint new_intersect_pt;
133  double distance;
134  bool done = false;
135  int iteration_count = 0;
136 
137  if(ray.hasNans())
138  {
139  gpt.makeNan();
140  return false;
141  }
142  //***
143  // Set the initial guess for horizontal intersect position as the ray's
144  // origin, and establish the datum and ellipsoid:
145  //***
146  const ossimDatum* datum = gpt.datum();
147  const ossimEllipsoid* ellipsoid = datum->ellipsoid();
148 // double lat, lon, h;
149 
150 // ellipsoid->XYZToLatLonHeight(ray.origin().x(),
151 // ray.origin().y(),
152 // ray.origin().z(),
153 // lat, lon, h);
154 // ossimGpt nadirGpt(lat, lon, h);
155 
156 // std::cout << "nadir pt = " << nadirGpt << std::endl;
157 
158  gpt = ossimGpt(prev_intersect_pt, datum);
159 
160  //
161  // Loop to iterate on ray intersection with variable elevation surface:
162  //
163  do
164  {
165  //
166  // Intersect ray with ellipsoid inflated by h_ellips:
167  //
168  h_ellips = getHeightAboveEllipsoid(gpt);
169  if ( ossim::isnan(h_ellips) ) h_ellips = defaultElevValue;
170 
171  intersected = ellipsoid->nearestIntersection(ray,
172  h_ellips,
173  new_intersect_pt);
174  if (!intersected)
175  {
176  //
177  // No intersection (looking over the horizon), so set ground point
178  // to NaNs:
179  //
180  gpt.makeNan();
181  done = true;
182  }
183  else
184  {
185  //
186  // Assign the ground point to the latest iteration's intersection
187  // point:
188  //
189  gpt = ossimGpt(new_intersect_pt, datum);
190 
191  //
192  // Determine if convergence achieved:
193  //
194  distance = (new_intersect_pt - prev_intersect_pt).magnitude();
195  if (distance < CONVERGENCE_THRESHOLD)
196  done = true;
197  else
198  {
199  prev_intersect_pt = new_intersect_pt;
200  }
201  }
202 
203  iteration_count++;
204 
205  } while ((!done) && (iteration_count < MAX_NUM_ITERATIONS));
206 
207  if (iteration_count == MAX_NUM_ITERATIONS)
208  {
209  if(traceDebug())
210  {
211  ossimNotify(ossimNotifyLevel_WARN) << "WARNING ossimElevSource::intersectRay: Max number of iterations reached solving for ground "
212  << "point. Result is probably inaccurate." << std::endl;
213  }
214  }
215 
216  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimElevSource::intersectRay: returning..." << std::endl;
217  return intersected;
218 }
const ossimEcefPoint & origin() const
Definition: ossimEcefRay.h:79
void makeNan()
Definition: ossimGpt.h:130
bool hasNans() const
Definition: ossimEcefRay.h:60
const ossimDatum * datum() const
datum().
Definition: ossimGpt.h:196
virtual const ossimEllipsoid * ellipsoid() const
Definition: ossimDatum.h:60
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)
bool isnan(const float &v)
isnan Test for floating point Not A Number (NAN) value.
Definition: ossimCommon.h:91

◆ pointHasCoverage()

virtual bool ossimElevSource::pointHasCoverage ( const ossimGpt ) const
pure virtual

◆ print()

std::ostream & ossimElevSource::print ( std::ostream &  out) const
virtual

Outputs theErrorStatus as an ossimErrorCode and an ossimString.

Returns
std::ostream&
Note
Derived classes should only have to implement a virtual print, not an operator<< funtion as it's implemented here.

Reimplemented from ossimSource.

Reimplemented in ossimElevManager, ossimImageElevationDatabase, ossimTiledElevationDatabase, ossimElevationCellDatabase, ossimElevCellHandler, ossimElevationDatabase, ossimGeneralRasterElevationDatabase, and ossimDtedElevationDatabase.

Definition at line 265 of file ossimElevSource.cpp.

References ossimSource::print(), theGroundRect, theMaxHeightAboveMSL, theMinHeightAboveMSL, theNullHeightValue, and theSeaLevelValue.

Referenced by ossimElevManager::print().

266 {
267  out << "\nossimElevSource @ "<< (ossim_uint64) this
268  << "\ntheMinHeightAboveMSL = "<<theMinHeightAboveMSL
269  << "\ntheMaxHeightAboveMSL = "<<theMaxHeightAboveMSL
270  << "\ntheNullHeightValue = "<<theNullHeightValue
271  << "\ntheSeaLevelValue = "<<theSeaLevelValue
272  << "\ntheGroundRect = "<<theGroundRect;
273  // GP: need this by itself. MS errors out
274  ossimSource::print(out);
275  return out;
276 }
double theMinHeightAboveMSL
Data members:
virtual std::ostream & print(std::ostream &out) const
Outputs theErrorStatus as an ossimErrorCode and an ossimString.
ossimGrect theGroundRect
unsigned long long ossim_uint64
double theMaxHeightAboveMSL

◆ setComputeStatisticsFlag()

void ossimElevSource::setComputeStatisticsFlag ( bool  flag)
virtual

Sets the flag which controls whether or not statistics will be computed upon opening a cell and not finding a corresponding statistics file.

Parameters
flagtrue to enable, false to disable.
Note
This flag can also be controlled by user via the ossim preferences keyword = "elevation.compute_statistics.enabled".

Definition at line 260 of file ossimElevSource.cpp.

References theComputeStatsFlag.

261 {
262  theComputeStatsFlag = flag;
263 }

Member Data Documentation

◆ theComputeStatsFlag

bool ossimElevSource::theComputeStatsFlag
protected

Definition at line 174 of file ossimElevSource.h.

Referenced by getComputeStatisticsFlag(), and setComputeStatisticsFlag().

◆ theGroundRect

ossimGrect ossimElevSource::theGroundRect
protected

◆ theMaxHeightAboveMSL

double ossimElevSource::theMaxHeightAboveMSL
protected

Definition at line 168 of file ossimElevSource.h.

Referenced by getMaxHeightAboveMSL(), and print().

◆ theMinHeightAboveMSL

double ossimElevSource::theMinHeightAboveMSL
protected

Data members:

Definition at line 167 of file ossimElevSource.h.

Referenced by getMinHeightAboveMSL(), and print().

◆ theNullHeightValue

double ossimElevSource::theNullHeightValue
protected

◆ theSeaLevelValue

double ossimElevSource::theSeaLevelValue
protected

Definition at line 170 of file ossimElevSource.h.

Referenced by getSeaLevelValue(), and print().


The documentation for this class was generated from the following files: