Loading...
Searching...
No Matches
KernelOperation.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/KernelOperation.h
22
23 \brief This file contains a class that represents the kernel operation.
24
25 \reference Adapted from TerraLib4.
26*/
27
28#ifndef __TERRALIB_SA_INTERNAL_KERNELOPERATION_H
29#define __TERRALIB_SA_INTERNAL_KERNELOPERATION_H
30
31// Terralib Includes
32#include "../Config.h"
33#include "KernelFunctions.h"
34#include "KernelParams.h"
35
36// STL Includes
37#include <map>
38#include <memory>
39
40
41namespace te
42{
43 //forward declarations
44 namespace da { class DataSetType; }
45 namespace gm { class Geometry; }
46 namespace mem { class DataSet; }
47 namespace rst { class Raster; }
48
49 namespace sa
50 {
51 /*!
52 \class KernelOperation
53
54 \brief Virtual class used to execute the kernel operations
55
56 \sa KernelFunctions
57 */
59 {
60 public:
61
62 /*! \brief Default constructor. */
64
65 /*! \brief Virtual destructor. */
67
68 public:
69
70 /*! \brief Function to execute the kernel operation. */
71 virtual void execute() = 0;
72
74
75 protected:
76
77 /*! Function used to build the tree with data set information */
78 virtual void buildTree() = 0;
79
80 /*! Function used to run kernel when output data is a raster */
82
83 /*! Function used to run kernel when output data is dataset */
84 std::unique_ptr<te::mem::DataSet> runDataSetKernel(te::sa::KernelInputParams* inputParams, te::sa::KernelTree& kTree, te::sa::KernelMap& kMap, te::da::DataSetType* dsType);
85
86 /*! Function used to create the output raster */
87 std::unique_ptr<te::rst::Raster> buildRaster(te::sa::KernelInputParams* inputParams, te::sa::KernelTree& kTree, std::string driver);
88
89 /*! Function used to create the output raster from extent layer*/
90 std::unique_ptr<te::rst::Raster> buildRaster(te::sa::KernelInputParams* inputParams, te::gm::Envelope extentLayer, std::string driver);
91
92 /*! Function used to save the output dataset */
94
95 /*! Function used to create the output dataset type */
96 std::unique_ptr<te::da::DataSetType> createDataSetType(te::da::DataSetType* dsType);
97
98 /*! Function used to create the output dataset */
99 std::unique_ptr<te::mem::DataSet> createDataSet(te::da::DataSet* inputDataSet, te::da::DataSetType* dsType);
100
101 protected:
102
103 std::unique_ptr<te::sa::KernelOutputParams> m_outputParams; //!< Attribute with the kernel output parameters.
104
105 te::sa::KernelTree m_kTree; //!< Attribute used to locate near geometries.
106 };
107 } // end namespace sa
108} // end namespace te
109
110#endif //__TERRALIB_SA_INTERNAL_KERNELOPERATION_H
This file contains a functions used by the kernel operation.
This file contains a class that represents the kernel parameters.
A class that models the description of a dataset.
Definition: DataSetType.h:73
A dataset is the unit of information manipulated by the data access module of TerraLib.
Definition: DataSet.h:114
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:52
An abstract class for raster data strucutures.
Definition: Raster.h:72
Class that represents the kernel input parameters.
Definition: KernelParams.h:55
Virtual class used to execute the kernel operations.
KernelOperation()
Default constructor.
virtual ~KernelOperation()
Virtual destructor.
void setOutputParameters(te::sa::KernelOutputParams *outParams)
std::unique_ptr< te::rst::Raster > buildRaster(te::sa::KernelInputParams *inputParams, te::sa::KernelTree &kTree, std::string driver)
void saveDataSet(te::da::DataSet *dataSet, te::da::DataSetType *dsType)
std::unique_ptr< te::sa::KernelOutputParams > m_outputParams
Attribute with the kernel output parameters.
void runRasterKernel(te::sa::KernelInputParams *inputParams, te::sa::KernelTree &kTree, te::sa::KernelMap &kMap, te::rst::Raster *raster)
std::unique_ptr< te::mem::DataSet > createDataSet(te::da::DataSet *inputDataSet, te::da::DataSetType *dsType)
te::sa::KernelTree m_kTree
Attribute used to locate near geometries.
std::unique_ptr< te::mem::DataSet > runDataSetKernel(te::sa::KernelInputParams *inputParams, te::sa::KernelTree &kTree, te::sa::KernelMap &kMap, te::da::DataSetType *dsType)
std::unique_ptr< te::da::DataSetType > createDataSetType(te::da::DataSetType *dsType)
virtual void execute()=0
Function to execute the kernel operation.
std::unique_ptr< te::rst::Raster > buildRaster(te::sa::KernelInputParams *inputParams, te::gm::Envelope extentLayer, std::string driver)
virtual void buildTree()=0
Class that represents the kernel output parameters.
Definition: KernelParams.h:97
std::map< int, std::pair< te::gm::Geometry *, double > > KernelMap
TerraLib.
#define TESAEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:133