OTB  9.0.0
Orfeo Toolbox
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
otb::GeographicalDistance< TVector > Class Template Reference

#include <otbGeographicalDistance.h>

+ Inheritance diagram for otb::GeographicalDistance< TVector >:
+ Collaboration diagram for otb::GeographicalDistance< TVector >:

Public Types

typedef itk::SmartPointer< const SelfConstPointer
 
typedef itk::SmartPointer< SelfPointer
 
typedef GeographicalDistance Self
 
typedef itk::Statistics::DistanceMetric< TVector > Superclass
 
typedef TVector VectorType
 

Public Member Functions

virtual ::itk::LightObject::Pointer CreateAnother (void) const
 
double Evaluate (const VectorType &x) const override
 
double Evaluate (const VectorType &x, const VectorType &y) const override
 
virtual double GetEarthRadius ()
 
virtual const char * GetNameOfClass () const
 
virtual void SetEarthRadius (double _arg)
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

 GeographicalDistance ()
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
 ~GeographicalDistance () override
 

Private Member Functions

 GeographicalDistance (const Self &)=delete
 
void operator= (const Self &)=delete
 

Private Attributes

double m_EarthRadius
 

Detailed Description

template<class TVector>
class otb::GeographicalDistance< TVector >

Compute the metric distance between two geographical points.

Vector length must be at least two, otherwise the Evaluate method will throw an exception.

First dimension is assumed to be the longitude, and second dimension is assumed to be the latitude.

This distance uses the Haversine formula, which can be found here: http://www.movable-type.co.uk/scripts/latlong.html

Please note that the computation makes use of the earth radius in meters. Mean radius (6371 km) is used as a default value, but one might use local values from spheroid or geoid for better precision.

Definition at line 50 of file otbGeographicalDistance.h.

Member Typedef Documentation

◆ ConstPointer

template<class TVector >
typedef itk::SmartPointer<const Self> otb::GeographicalDistance< TVector >::ConstPointer

Definition at line 58 of file otbGeographicalDistance.h.

◆ Pointer

template<class TVector >
typedef itk::SmartPointer<Self> otb::GeographicalDistance< TVector >::Pointer

Definition at line 57 of file otbGeographicalDistance.h.

◆ Self

template<class TVector >
typedef GeographicalDistance otb::GeographicalDistance< TVector >::Self

Standard class typedefs.

Definition at line 55 of file otbGeographicalDistance.h.

◆ Superclass

template<class TVector >
typedef itk::Statistics::DistanceMetric<TVector> otb::GeographicalDistance< TVector >::Superclass

Definition at line 56 of file otbGeographicalDistance.h.

◆ VectorType

template<class TVector >
typedef TVector otb::GeographicalDistance< TVector >::VectorType

Useful typedefs

Definition at line 64 of file otbGeographicalDistance.h.

Constructor & Destructor Documentation

◆ GeographicalDistance() [1/2]

template<class TVector >
otb::GeographicalDistance< TVector >::GeographicalDistance
protected

Constructor

Definition at line 31 of file otbGeographicalDistance.hxx.

◆ ~GeographicalDistance()

template<class TVector >
otb::GeographicalDistance< TVector >::~GeographicalDistance ( )
inlineoverrideprotected

Destructor

Definition at line 87 of file otbGeographicalDistance.h.

◆ GeographicalDistance() [2/2]

template<class TVector >
otb::GeographicalDistance< TVector >::GeographicalDistance ( const Self )
privatedelete

Member Function Documentation

◆ CreateAnother()

template<class TVector >
virtual::itk::LightObject::Pointer otb::GeographicalDistance< TVector >::CreateAnother ( void  ) const

◆ Evaluate() [1/2]

template<class TVector >
double otb::GeographicalDistance< TVector >::Evaluate ( const VectorType x) const
override

Gets the distance between the origin point and x. This function work with SetOrigin() function

Definition at line 37 of file otbGeographicalDistance.hxx.

◆ Evaluate() [2/2]

template<class TVector >
double otb::GeographicalDistance< TVector >::Evaluate ( const VectorType x,
const VectorType y 
) const
override

Definition at line 53 of file otbGeographicalDistance.hxx.

References otb::CONST_PI.

◆ GetEarthRadius()

template<class TVector >
virtual double otb::GeographicalDistance< TVector >::GetEarthRadius ( )
virtual

Get the earth radius

◆ GetNameOfClass()

template<class TVector >
virtual const char* otb::GeographicalDistance< TVector >::GetNameOfClass ( ) const
virtual

Run-time type information (and related methods).

◆ New()

template<class TVector >
static Pointer otb::GeographicalDistance< TVector >::New ( )
static

Method for creation through the object factory.

◆ operator=()

template<class TVector >
void otb::GeographicalDistance< TVector >::operator= ( const Self )
privatedelete

◆ PrintSelf()

template<class TVector >
void otb::GeographicalDistance< TVector >::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
overrideprotected

PrintSelf method

Definition at line 78 of file otbGeographicalDistance.hxx.

◆ SetEarthRadius()

template<class TVector >
virtual void otb::GeographicalDistance< TVector >::SetEarthRadius ( double  _arg)
virtual

Set the earth radius

Member Data Documentation

◆ m_EarthRadius

template<class TVector >
double otb::GeographicalDistance< TVector >::m_EarthRadius
private

Earth radius

Definition at line 99 of file otbGeographicalDistance.h.


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