OTB  9.0.0
Orfeo Toolbox
otbGeographicalDistance.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2022 Centre National d'Etudes Spatiales (CNES)
3  *
4  * This file is part of Orfeo Toolbox
5  *
6  * https://www.orfeo-toolbox.org/
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #ifndef otbGeographicalDistance_h
22 #define otbGeographicalDistance_h
23 
24 #include "itkNumericTraits.h"
25 #include "itkDistanceMetric.h"
26 
27 namespace otb
28 {
49 template <class TVector>
50 class ITK_EXPORT GeographicalDistance : public itk::Statistics::DistanceMetric<TVector>
51 {
52 public:
53 
56  typedef itk::Statistics::DistanceMetric<TVector> Superclass;
57  typedef itk::SmartPointer<Self> Pointer;
58  typedef itk::SmartPointer<const Self> ConstPointer;
59 
61  itkTypeMacro(GeographicalDistance, itk::Statistics::DistanceMetric);
62 
64  itkNewMacro(Self);
65 
67  typedef TVector VectorType;
68 
71  double Evaluate(const VectorType& x) const override;
72 
73  /* Gets the distance between x and y points */
74  double Evaluate(const VectorType& x, const VectorType& y) const override;
75 
77  itkSetMacro(EarthRadius, double);
78 
80  itkGetMacro(EarthRadius, double);
81 
82 protected:
85 
88  {
89  }
90 
92  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
93 
94 private:
95  GeographicalDistance(const Self&) = delete;
96  void operator=(const Self&) = delete;
97 
99  double m_EarthRadius;
100 };
101 
102 } // end namespace otb
103 
104 #ifndef OTB_MANUAL_INSTANTIATION
106 #endif
107 
108 #endif
otb::GeographicalDistance::Self
GeographicalDistance Self
Definition: otbGeographicalDistance.h:55
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otbGeographicalDistance.hxx
otb::GeographicalDistance::~GeographicalDistance
~GeographicalDistance() override
Definition: otbGeographicalDistance.h:87
otb::GeographicalDistance::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbGeographicalDistance.h:57
otb::GeographicalDistance::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbGeographicalDistance.h:58
otb::GeographicalDistance::VectorType
TVector VectorType
Definition: otbGeographicalDistance.h:64
otb::GeographicalDistance
Compute the metric distance between two geographical points.
Definition: otbGeographicalDistance.h:50
otb::GeographicalDistance::m_EarthRadius
double m_EarthRadius
Definition: otbGeographicalDistance.h:99
otb::GeographicalDistance::Superclass
itk::Statistics::DistanceMetric< TVector > Superclass
Definition: otbGeographicalDistance.h:56