Slope.h
Go to the documentation of this file.
1 /*!
2 \file terralib/mnt/core/Slope.h
3 
4 \brief This file contains a class to generate a Slope grid.
5 Adapted from SPRING
6 */
7 
8 #ifndef __TERRALIB_MNT_INTERNAL_SLOPE_H
9 #define __TERRALIB_MNT_INTERNAL_SLOPE_H
10 
11 // Terralib Includes
12 #include "Config.h"
13 #include "Enums.h"
14 #include "Tin.h"
15 
16 
17 #include "../../dataaccess/dataset/DataSet.h"
18 #include "../../dataaccess/dataset/DataSetType.h"
19 #include "../../dataaccess/datasource/DataSource.h"
20 
21 namespace te
22 {
23  namespace mnt
24  {
25  class TEMNTEXPORT Slope : public Tin
26  {
27  public:
28  Slope();
29  ~Slope();
30 
32  std::string inDsetName,
33  std::unique_ptr<te::da::DataSetType> inDsetType);
34 
35  void setOutput(std::map<std::string, std::string> &dsinfo);
36 
37  void setParams(double resx, double resy, char gradtype, char slopetype, int srid, double dummy);
38 
39  bool run();
40 
41  private:
42 
43  /*!
44  \brief Method that calculates a gradient value (slope or aspect) in a given triangle
45  \param nodesid is a pointer to the triangle node identifications
46  \param gradtype is the type of gradient ('s' slope or 'a' aspect)
47  \param slopetype is the type of slope ('g' degree or 'p' percentage)
48  \return the calculated gradient z value
49  */
50  double TriangleGradient(int32_t *nodesid, char gradtype, char slopetype);
51 
52  /*!
53  \brief METHOD TO CALCULATE GRADIENT VECTOR COMPONENTS IN THE POINT L,C OF THE GRID
54  \param raster input grid
55  \param l and c are the line and column of the input grid
56  \param dzdx and dzdy are values of the first derivatives of z in the x and y directions at location l,c
57  \return true when the gradient is evaluated
58  \return false when the gradient could not be evaluated
59  */
60  bool CalcGradientRst(std::unique_ptr<te::rst::Raster> &raster, unsigned l, unsigned c, double& dzdx, double& dzdy);
61 
62  protected:
63 
65  std::string m_inDsetName;
66  std::unique_ptr<te::da::DataSetType> m_inDsetType;
67 
68  std::map<std::string, std::string> m_dsinfo;
69  char m_gradtype, m_slopetype;
70 
71  mntType m_inputType; //!< Input type (TIN, GRID)
72 
73  double m_tol;
74  double m_min, m_max;
75  double m_dx, m_dy;
76  double m_dummy;
77  };
78  }
79 }
80 #endif //__TERRALIB_MNT_INTERNAL_SLOPE_H
Tin.h
This file contains a class to define a TIN. Adapted from SPRING.
te
TerraLib.
Definition: AddressGeocodingOp.h:52
te::mnt::Slope::m_slopetype
char m_slopetype
Definition: Slope.h:69
te::mnt::Tin
Class to define TIN strutures.
Definition: Tin.h:277
te::mnt::Slope::TriangleGradient
double TriangleGradient(int32_t *nodesid, char gradtype, char slopetype)
Method that calculates a gradient value (slope or aspect) in a given triangle.
te::mnt::mntType
mntType
Definition: Enums.h:79
te::mnt::Slope::m_dy
double m_dy
Definition: Slope.h:75
te::mnt::Slope::Slope
Slope()
te::mnt::Slope::m_inputType
mntType m_inputType
Input type (TIN, GRID)
Definition: Slope.h:71
te::mnt::Slope::run
bool run()
te::mnt::Slope::m_inDsetName
std::string m_inDsetName
Definition: Slope.h:65
Enums.h
Enumerations of XML module.
te::mnt::Slope::CalcGradientRst
bool CalcGradientRst(std::unique_ptr< te::rst::Raster > &raster, unsigned l, unsigned c, double &dzdx, double &dzdy)
METHOD TO CALCULATE GRADIENT VECTOR COMPONENTS IN THE POINT L,C OF THE GRID.
te::mnt::Slope::m_dsinfo
std::map< std::string, std::string > m_dsinfo
Definition: Slope.h:68
te::mnt::Slope::m_inDsrc
te::da::DataSourcePtr m_inDsrc
Definition: Slope.h:64
te::mnt::Slope::~Slope
~Slope()
te::mnt::Slope::setInput
void setInput(te::da::DataSourcePtr inDsrc, std::string inDsetName, std::unique_ptr< te::da::DataSetType > inDsetType)
te::mnt::Slope::m_inDsetType
std::unique_ptr< te::da::DataSetType > m_inDsetType
Definition: Slope.h:66
te::mnt::Slope::m_dummy
double m_dummy
Definition: Slope.h:76
te::da::DataSourcePtr
boost::shared_ptr< DataSource > DataSourcePtr
Definition: DataSource.h:1449
te::mnt::Slope::m_tol
double m_tol
Definition: Slope.h:73
Config.h
Proxy configuration file for TerraView (see terraview_config.h).
te::mnt::Slope::m_min
double m_min
Definition: Slope.h:74
TEMNTEXPORT
#define TEMNTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:41
te::mnt::Slope::setOutput
void setOutput(std::map< std::string, std::string > &dsinfo)
te::mnt::Slope::setParams
void setParams(double resx, double resy, char gradtype, char slopetype, int srid, double dummy)
te::mnt::Slope
Definition: Slope.h:26