Register.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/rp/Register.h
22  \brief Performs raster data registering into a SRS using a set of tie points.
23  */
24 
25 #ifndef __TERRALIB_RP_INTERNAL_REGISTER_H
26 #define __TERRALIB_RP_INTERNAL_REGISTER_H
27 
28 #include "Algorithm.h"
29 #include "../raster/Raster.h"
30 #include "../raster/Interpolator.h"
31 #include "../geometry/Envelope.h"
32 #include "../geometry/GTParameters.h"
33 #include "../geometry/GeometricTransformation.h"
34 
35 #include <vector>
36 #include <string>
37 #include <memory>
38 
39 namespace te
40 {
41  namespace rp
42  {
43  /*!
44  \class Register
45  \brief Performs raster data registering into a SRS using a set of tie points.
46  \ingroup rp_gen
47  */
48  class TERPEXPORT Register : public Algorithm
49  {
50  public:
51 
52  /*!
53  \class InputParameters
54  \brief Register input parameters
55  */
57  {
58  public:
59 
60  bool m_enableProgress; //!< Enable/Disable the progress interface (default:false).
61 
62  bool m_enableRasterCache; // Enable/disable input raster cache (default:true).
63 
64  te::rst::Raster const* m_inputRasterPtr; //!< Input raster.
65 
66  std::vector< unsigned int > m_inputRasterBands; //!< Bands to process from the input raster.
67 
68  std::vector< te::gm::GTParameters::TiePoint > m_tiePoints; //!< Tie-points between each raster point (te::gm::GTParameters::TiePoint::first are raster lines/columns ) and their respective coordinates under the chosen SRS (te::gm::GTParameters::TiePoint::second).
69 
70  int m_outputSRID; //!< The output raster SRID (default:0).
71 
72  double m_outputResolutionX; //!< The output raster X axis resolution (default:1).
73 
74  double m_outputResolutionY; //!< The output raster Y axis resolution (default:1).
75 
76  te::rst::Interpolator::Method m_interpMethod; //!< The raster interpolator method (default:NearestNeighbor).
77 
78  double m_noDataValue; //!< The pixel value used where no raster data is avaliable (defaul:0).
79 
80  std::string m_geomTransfName; //!< The name of the geometric transformation used (see each te::gm::GTFactory inherited classes to find each factory key/name, default:Affine).
81 
82  te::gm::GeometricTransformation const* m_geomTransfPtr; //!< An optional pointer to a valid geometric transformation instance (direct mapping raster lines/columns to and their respective coordinates under the chosen SRS) that will be used by the register process (if this pionter is used, m_tiePoints and m_geomTransfName will be ignored).
83 
84  te::gm::Envelope m_outputBoundingBox; //!< An optional bounding box (under the chosen SRS) to use for the generated output raster (default: automatically calculated).
85 
87 
89 
91 
92  //overload
93  void reset() throw( te::rp::Exception );
94 
95  //overload
96  const InputParameters& operator=( const InputParameters& params );
97 
98  //overload
99  AbstractParameters* clone() const;
100  };
101 
102  /*!
103  \class OutputParameters
104  \brief Register output parameters
105  */
107  {
108  public:
109 
110  std::string m_rType; //!< Output raster data source type (as described in te::raster::RasterFactory ).
111 
112  std::map< std::string, std::string > m_rInfo; //!< The necessary information to create the output rasters (as described in te::raster::RasterFactory).
113 
114  std::unique_ptr< te::rst::Raster > m_outputRasterPtr; //!< The generated output registered raster.
115 
117 
119 
121 
122  //overload
123  void reset() throw( te::rp::Exception );
124 
125  //overload
126  const OutputParameters& operator=( const OutputParameters& params );
127 
128  //overload
129  AbstractParameters* clone() const;
130  };
131 
133 
135 
136  //overload
137  bool execute( AlgorithmOutputParameters& outputParams ) throw( te::rp::Exception );
138 
139  //overload
140  void reset() throw( te::rp::Exception );
141 
142  //overload
143  bool initialize( const AlgorithmInputParameters& inputParams ) throw( te::rp::Exception );
144 
145  bool isInitialized() const;
146 
147  protected:
148 
149  Register::InputParameters m_inputParameters; //!< Input execution parameters.
150 
151  bool m_isInitialized; //!< Tells if this instance is initialized.
152 
153 
154  };
155 
156  } // end namespace rp
157 } // end namespace te
158 
159 #endif
160 
te::rp::Register::InputParameters::m_geomTransfName
std::string m_geomTransfName
The name of the geometric transformation used (see each te::gm::GTFactory inherited classes to find e...
Definition: Register.h:80
te::gm::Envelope
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:52
te
TerraLib.
Definition: AddressGeocodingOp.h:52
te::rp::Register::InputParameters::m_inputRasterPtr
te::rst::Raster const * m_inputRasterPtr
Input raster.
Definition: Register.h:64
te::rp::AlgorithmOutputParameters
Raster Processing algorithm output parameters base interface.
Definition: AlgorithmOutputParameters.h:40
te::rp::Register::InputParameters::m_enableRasterCache
bool m_enableRasterCache
Definition: Register.h:62
te::rp::Register
Performs raster data registering into a SRS using a set of tie points.
Definition: Register.h:49
te::rst::Raster
An abstract class for raster data strucutures.
Definition: Raster.h:72
te::rp::Register::OutputParameters::m_rType
std::string m_rType
Output raster data source type (as described in te::raster::RasterFactory ).
Definition: Register.h:110
te::rp::AlgorithmInputParameters
Raster Processing algorithm input parameters base interface.
Definition: AlgorithmInputParameters.h:40
te::rp::Register::InputParameters::m_geomTransfPtr
te::gm::GeometricTransformation const * m_geomTransfPtr
An optional pointer to a valid geometric transformation instance (direct mapping raster lines/columns...
Definition: Register.h:82
te::rp::Register::OutputParameters::OutputParameters
OutputParameters(const OutputParameters &)
te::rp::Register::InputParameters::m_outputSRID
int m_outputSRID
The output raster SRID (default:0).
Definition: Register.h:70
te::rp::Register::InputParameters::InputParameters
InputParameters()
te::rp::Register::InputParameters::reset
void reset()
Clear all internal allocated resources and reset the parameters instance to its initial state.
te::rp::Register::InputParameters::m_enableProgress
bool m_enableProgress
Enable/Disable the progress interface (default:false).
Definition: Register.h:60
te::rp::Register::InputParameters::m_inputRasterBands
std::vector< unsigned int > m_inputRasterBands
Bands to process from the input raster.
Definition: Register.h:66
te::rp::Register::OutputParameters::m_outputRasterPtr
std::unique_ptr< te::rst::Raster > m_outputRasterPtr
The generated output registered raster.
Definition: Register.h:114
te::rp::Register::InputParameters::m_outputResolutionX
double m_outputResolutionX
The output raster X axis resolution (default:1).
Definition: Register.h:72
te::rp::Algorithm
Raster Processing algorithm base interface.
Definition: Algorithm.h:42
te::rp::Register::InputParameters::m_tiePoints
std::vector< te::gm::GTParameters::TiePoint > m_tiePoints
Tie-points between each raster point (te::gm::GTParameters::TiePoint::first are raster lines/columns ...
Definition: Register.h:68
te::rst::InterpolationMethod
InterpolationMethod
Allowed interpolation methods.
Definition: Enums.h:93
te::rp::Register::OutputParameters::OutputParameters
OutputParameters()
te::rp::Register::OutputParameters::reset
void reset()
Clear all internal allocated resources and reset the parameters instance to its initial state.
te::Exception
Base exception class for plugin module.
Definition: Exception.h:42
te::rp::Register::InputParameters::m_outputBoundingBox
te::gm::Envelope m_outputBoundingBox
An optional bounding box (under the chosen SRS) to use for the generated output raster (default: auto...
Definition: Register.h:84
te::rp::Register::InputParameters::m_noDataValue
double m_noDataValue
The pixel value used where no raster data is avaliable (defaul:0).
Definition: Register.h:78
TERPEXPORT
#define TERPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:139
te::rp::Register::OutputParameters::~OutputParameters
~OutputParameters()
te::rp::Register::InputParameters::~InputParameters
~InputParameters()
Algorithm.h
Abstract algorithm.
te::gm::GeometricTransformation
2D Geometric transformation base class.
Definition: GeometricTransformation.h:57
te::rp::Register::InputParameters::m_interpMethod
te::rst::Interpolator::Method m_interpMethod
The raster interpolator method (default:NearestNeighbor).
Definition: Register.h:76
te::rp::Register::InputParameters::m_outputResolutionY
double m_outputResolutionY
The output raster Y axis resolution (default:1).
Definition: Register.h:74
te::rp::Register::InputParameters
Register input parameters.
Definition: Register.h:57
te::rp::Register::OutputParameters
Register output parameters.
Definition: Register.h:107
te::rp::Register::InputParameters::InputParameters
InputParameters(const InputParameters &)
te::rp::Register::OutputParameters::m_rInfo
std::map< std::string, std::string > m_rInfo
The necessary information to create the output rasters (as described in te::raster::RasterFactory).
Definition: Register.h:112