GeoTessCPP  2.2
Software to facilitate storage and retrieval of 3D information about the Earth.
Public Member Functions | Protected Member Functions | List of all members
geotess::GeoTessPositionNaturalNeighbor Class Reference

Implements the Natural Neighbor Interpolation algorithm for the geographic dimensions of the grid. More...

#include <GeoTessPositionNaturalNeighbor.h>

Inheritance diagram for geotess::GeoTessPositionNaturalNeighbor:
geotess::GeoTessPosition

Public Member Functions

 GeoTessPositionNaturalNeighbor (GeoTessModel *model, const GeoTessInterpolatorType &radialType)
 Standard Constructor. More...
 
virtual ~GeoTessPositionNaturalNeighbor ()
 Destructor. More...
 
virtual const GeoTessInterpolatorTypegetInterpolatorType () const
 Retrieve the type of interpolation that this GeoTessPosition object is configured to perform. More...
 
virtual long getMemory ()
 Retrieve the amount of memory consumed by this GeoTessPosition object. More...
 
- Public Member Functions inherited from geotess::GeoTessPosition
virtual ~GeoTessPosition ()
 Destructor. More...
 
void addReference ()
 Add reference count;. More...
 
void copyVector (double *u)
 Copy the contents of the unit vector that corresponds to the current position into the supplied double* which must have at least 3 elements. More...
 
const double * getClosestVertex () const
 Retrieve the unit vector of the vertex wiht the highest interpolation coefficient. More...
 
void getCoefficients (map< int, double > &coefficients)
 Retrieve a map from pointIndex to interpolation coefficient. More...
 
double getDepth ()
 Retrieve the depth of the current position in km. More...
 
double getDepthBottom ()
 Retrieve an interpolated value of the depth of the bottom of the current layer. More...
 
double getDepthBottom (int layid)
 Retrieve an interpolated value of the depth of the bottom of the current layer. More...
 
double getDepthTop ()
 Retrieve an interpolated value of the depth of the top of the current layer. More...
 
double getDepthTop (int layid)
 Retrieve an interpolated value of the depth of the top of the current layer. More...
 
double getEarthRadius ()
 Retrieve the radius of the Earth at this position, in km. More...
 
double getErrorValue ()
 If any calculated value is Double.NaN, then functions like getValue() or getRadiusTop() or getRadiusBottom() will return this errorValue. More...
 
double getHorizontalCoefficient (int index) const
 Retrieve the interpolation coefficient associated with one of the vertices of the tessellation used to interpolate data. More...
 
const vector< double > & getHorizontalCoefficients () const
 Retrieve a reference to the horizontal interpolation coefficients associated with the vertices of the tessellation used to interpolate data. More...
 
int getIndexOfClosestVertex () const
 Retrieve the index of the highest interpolation coefficient. More...
 
int getLayerId (double rad)
 Retrieve the index of the layer that contains the specified radius. More...
 
int getLayerId ()
 
double getLayerThickness (int layid)
 Retrieve the thickness of specified layer, in km. More...
 
double getLayerThickness ()
 Retrieve the thickness of specified layer, in km. More...
 
int getMaxTessLevel (int layid)
 Retrieve the current value of maxTessLevel, which is the maximum tessellation level such that the triangle that is found during a walking triangle search will be on a tessellation level that is no higher than the specified value. More...
 
GeoTessModelgetModel ()
 
int getNVertices ()
 Return the number of vertices (3 for LINEAR interpolation, more for natural neighbor). More...
 
double getRadius ()
 Retrieve the radius of the current position, in km. More...
 
double getRadiusBottom (int layid)
 Retrieve an interpolated value of the radius of the bottom of the specified layer, in km. More...
 
double getRadiusBottom ()
 Retrieve an interpolated value of the radius of the bottom of the current layer. More...
 
double getRadiusTop (int layid)
 Retrieve an interpolated value of the radius of the top of the specified layer, in km. More...
 
double getRadiusTop ()
 Retrieve an interpolated value of the radius of the top of the current layer. More...
 
int getReferenceCount ()
 Retrieve reference count - number of other objects that hold a reference to this position object. More...
 
int getTessID ()
 
int getTessLevel () const
 Retrieve the index of the tessellation level of the triangle that was found the last time that the walinkg triangle algorithm was executed. More...
 
int getTessLevel (const int &tId)
 Retrieve the index of the tessellation level of the triangle that was found the last time that the walking triangle algorithm was executed. More...
 
int getTriangle ()
 Retrieve the index of the triangle within which the current position is located. More...
 
virtual double getValue (int attribute)
 Retrieve an interpolated value of the specified model attribute. More...
 
double * getVector ()
 Retrieve a reference to the 3 component unit vector that corresponds to the current position. More...
 
int getVertex (int index)
 Return the index of one of the vertices used to interpolate data. More...
 
int getVertexIndex ()
 If the position of this GeoTessPosition object is currently set to a location that coincides with one of the grid vertices, return the index of that vertex. More...
 
const vector< int > & getVertices () const
 Return a reference to the array containing the indexes of vertices in the 2D grid that will be involved in the interpolation of data. More...
 
void getWeights (map< int, double > &weights, double dkm)
 Add the weights of the current interpolation position to the supplied map of weights. More...
 
bool isNotReferenced ()
 Returns true if reference count is zero. More...
 
bool isRadiusOutOfRangeAllowed ()
 Controls radius out-of-range behavior. More...
 
bool noEmptyProfiles ()
 Returns true if the current interpolation position has no empty profiles. More...
 
void removeReference ()
 Remove reference count;. More...
 
void set (double lat, double lon, double depth)
 Set the interpolation point to specified latitude and and longitude in degrees and depth in km below sea level. More...
 
void set (const double *const uVector, const double &newRadius)
 Set the interpolation point. More...
 
void set (int layid, double lat, double lon, double depth)
 Set the interpolation point to specified latitude and longitude in degrees and depth in km below sea level. More...
 
void set (int layid, const double *const uVector, double rad)
 Set the interpolation point. More...
 
void setBottom (int layid, const double *const uVector)
 Set the 2D position to unitVector and radius to the radius of the bottom of the specified layer. More...
 
void setBottom (int layid)
 Set the radius to the radius of the bottom of the specified layer. More...
 
void setDepth (int layer, double depth)
 Change the current layer and/or depth without changing the geographic position. More...
 
void setDepth (double depth)
 Change the current depth without changing the geographic position. More...
 
void setErrorValue (double errVal)
 If any calculated value is NaN, then functions like getValue() or getRadiusTop() or getRadiusBottom() will return this value. More...
 
void setMaxTessLevel (int layid, int maxTess)
 Set the maximum tessellation level such that the triangle that is found during a walking triangle search will be on a tessellation level that is no higher than the specified value. More...
 
void setModel (GeoTessModel *newModel)
 Replace the model that currently supports this GeoTessPosition object with a new model. More...
 
void setRadius (int layid, double rad)
 Change the current radius without changing the geographic position. More...
 
void setRadius (double rad)
 Change the current radius without changing the geographic position. More...
 
void setRadiusOutOfRangeAllowed (bool allowed)
 Controls radius out-of-range behavior. More...
 
void setTop (int layid, const double *const uVector)
 Set the 2D position to unitVector and radius to the radius of the top of the specified layer. More...
 
void setTop (int layid)
 Set the radius to the radius of the top of the specified layer. More...
 
string toString ()
 Returns position as a string. More...
 

Protected Member Functions

virtual void update2D (int tid)
 Update the vertices and their associated interpolation coefficients, that will be used to interpolate new values. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from geotess::GeoTessPosition
static GeoTessPositiongetGeoTessPosition (GeoTessModel *model)
 Static factory method to create a new GeoTessPosition object. More...
 
static GeoTessPositiongetGeoTessPosition (GeoTessModel *model, const GeoTessInterpolatorType &horizontalType)
 Static factory method to create a new GeoTessPosition object. More...
 
static GeoTessPositiongetGeoTessPosition (GeoTessModel *model, const GeoTessInterpolatorType &horizontalType, const GeoTessInterpolatorType &radialType)
 Static factory method to create a new GeoTessPosition object. More...
 

Detailed Description

Implements the Natural Neighbor Interpolation algorithm for the geographic dimensions of the grid.

Implements the Natural Neighbor Interpolation algorithm of Sibson (1980, 1981). This technique interpolates values stored on a Delaunay triangulation. Returned values are continuous everywhere and smooth everywhere except the vertices of the triangulation. Implementation of the algorithm is described in detail in Hipp et al. (1999).

Hipp, J. R., C. J. Young, S. G. Moore, E. R. Shepherd, C. A. Schultz and S. C. Myers (1999), Parametric Grid Information in the DOE Knowledge Base: Data Preparation, Storage, and Access, SAND99-2277, Sandia National Laboratories Report.

Sibson, R., (1980) A Vector Identity for the Dirichlet Tessellation, Proc. Cambridge Philosophical Society, 87, 151-155.

Sibson, R. (1981). "A brief description of natural neighbor interpolation (Chapter 2)". In V. Barnett. Interpreting Multivariate Data. Chichester: John Wiley. pp. 21�36.

Author
Sandy Ballard

Constructor & Destructor Documentation

geotess::GeoTessPositionNaturalNeighbor::GeoTessPositionNaturalNeighbor ( GeoTessModel model,
const GeoTessInterpolatorType radialType 
)

Standard Constructor.

virtual geotess::GeoTessPositionNaturalNeighbor::~GeoTessPositionNaturalNeighbor ( )
virtual

Destructor.

Member Function Documentation

virtual const GeoTessInterpolatorType& geotess::GeoTessPositionNaturalNeighbor::getInterpolatorType ( ) const
inlinevirtual

Retrieve the type of interpolation that this GeoTessPosition object is configured to perform.

Either InterpolatorType.LINEAR or InterpolatorType.NATURAL_NEIGHBOR.

Reimplemented from geotess::GeoTessPosition.

virtual long geotess::GeoTessPositionNaturalNeighbor::getMemory ( )
inlinevirtual

Retrieve the amount of memory consumed by this GeoTessPosition object.

Returns
memory in bytes.

Reimplemented from geotess::GeoTessPosition.

virtual void geotess::GeoTessPositionNaturalNeighbor::update2D ( int  tid)
protectedvirtual

Update the vertices and their associated interpolation coefficients, that will be used to interpolate new values.

Uses the natural neighbor interpolation algorithm originally proposed by Sibson, R. (1980), A Vector Identity For Dirichlet Tessellation, Proc. Cambridge Philosophical Society, 87, 151-155. The algorithm is described in detail in Hipp, J. R., C. J. Young, S. G. Moore, E. R. Shepherd, C. A. Schultz and S. C. Myers (1999), Parametric Grid Information in the DOE Knowledge Base: Data Preparation, Storage, and Access, SAND99-2277, Sandia National Laboratories Report.


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