GeostatisticalMethod.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/sa/core/GeostatisticalMethod.h
22 
23  \brief This file contains a virtual class that represents the geostatistical method.
24 
25  \reference Adapted from TerraLib4.
26 */
27 
28 #ifndef __TERRALIB_SA_INTERNAL_GEOSTATISTICALMETHOD_H
29 #define __TERRALIB_SA_INTERNAL_GEOSTATISTICALMETHOD_H
30 
31 // Terralib Includes
32 #include "../Config.h"
33 
34 // STL Includes
35 #include <memory>
36 
37 // Boost
38 #include <boost/numeric/ublas/matrix.hpp>
39 
40 namespace te
41 {
42  namespace sa
43  {
44  /*!
45  \class GeostatisticalMethod
46 
47  \brief Geostatistics is used for modelling spatial data. It provides accurate and
48  reliable estimations of phenomena at locations where no measurements are available.
49 
50  Geostatistics has been defined by G. Matheron as "the application of probabilistic methods
51  to regionalized variables", which designates any function displayed in a real space.
52  At the difference of conventional statistics, whatever the complexity and the irregularity
53  of the real phenomenon, geostatistics search to exhibit a structure of spatial correlation.
54  This accounts for the intuitive idea that points close in the space should be likely close
55  in values. In other words randomness does not mean independence.
56 
57  */
59  {
60  public:
61 
62  /*! \brief Default constructor. */
64  {
65  m_angleDirection = 0.;
66  m_angleTolerance = 0.;
67  m_lagIncrement = 0.;
68  m_nLags = 0;
69  };
70 
71  /*! \brief Virtual destructor. */
73  {
74  m_dataMatrix.clear();
75  }
76 
77  public:
78 
79  /*! \brief Function to calculate the geostatistical information. */
80  virtual boost::numeric::ublas::matrix<double> calculate() = 0;
81 
82  /*! \brief Function to set the angle direction. */
83  void setAngleDirection(double value)
84  {
85  m_angleDirection = value;
86  }
87 
88  /*! \brief Function to get the angle direction. */
90  {
91  return m_angleDirection;
92  }
93 
94  /*! \brief Function to set the angle tolerance. */
95  void setAngleTolerance(double value)
96  {
97  m_angleTolerance = value;
98  }
99 
100  /*! \brief Function to get the angle tolerance. */
102  {
103  return m_angleTolerance;
104  }
105 
106  /*! \brief Function to set the lag increment. */
107  void setLagIncrement(double value)
108  {
109  m_lagIncrement = value;
110  }
111 
112  /*! \brief Function to get the lag increment. */
114  {
115  return m_lagIncrement;
116  }
117 
118  /*! \brief Function to set the number of lags. */
119  void setNumberOfLags(std::size_t value)
120  {
121  m_nLags = value;
122  }
123 
124  /*! \brief Function to get the number of lags. */
125  std::size_t getNumberOfLags()
126  {
127  return m_nLags;
128  }
129 
130  /*! \brief Function to set the input matrix with data information. */
131  void setMatrix(boost::numeric::ublas::matrix<double> matrix)
132  {
133  m_dataMatrix = matrix;
134  }
135 
136  /*! \brief Function to get the input matrix with data information. */
137  boost::numeric::ublas::matrix<double>& getMatrix()
138  {
139  return m_dataMatrix;
140  }
141 
142  protected:
143 
144  double m_angleDirection; //!< Attribute used to define the direction used to calculate the variogram.
145 
146  double m_angleTolerance; //!< Attribute used to define the minimum and maximum angular direction.
147 
148  double m_lagIncrement; //!< Attribute used to define the distance between each lag.
149 
150  std::size_t m_nLags; //!< Attribute used to specifies the basic distance unit.
151 
152  boost::numeric::ublas::matrix<double> m_dataMatrix; //!< Matrix with input data information.
153 
154  };
155  } // end namespace sa
156 } // end namespace te
157 
158 #endif //__TERRALIB_SA_INTERNAL_GEOSTATISTICALMETHOD_H
double m_lagIncrement
Attribute used to define the distance between each lag.
void setNumberOfLags(std::size_t value)
Function to set the number of lags.
virtual ~GeostatisticalMethod()
Virtual destructor.
double getAngleDirection()
Function to get the angle direction.
boost::numeric::ublas::matrix< double > m_dataMatrix
Matrix with input data information.
double getAngleTolerance()
Function to get the angle tolerance.
void setAngleDirection(double value)
Function to set the angle direction.
void setAngleTolerance(double value)
Function to set the angle tolerance.
std::size_t m_nLags
Attribute used to specifies the basic distance unit.
URI C++ Library.
GeostatisticalMethod()
Default constructor.
double m_angleTolerance
Attribute used to define the minimum and maximum angular direction.
void setLagIncrement(double value)
Function to set the lag increment.
boost::numeric::ublas::matrix< double > & getMatrix()
Function to get the input matrix with data information.
Geostatistics is used for modelling spatial data. It provides accurate and reliable estimations of ph...
#define TESAEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:133
std::size_t getNumberOfLags()
Function to get the number of lags.
void setMatrix(boost::numeric::ublas::matrix< double > matrix)
Function to set the input matrix with data information.
double getLagIncrement()
Function to get the lag increment.
double m_angleDirection
Attribute used to define the direction used to calculate the variogram.