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() ;
94 
95  //overload
96  const InputParameters& operator=( const InputParameters& params );
97 
98  //overload
99  AbstractParameters* clone() const;
100 
101  //overload
102  bool serialize ( AlgorithmParametersSerializer& serializer ) const;
103  };
104 
105  /*!
106  \class OutputParameters
107  \brief Register output parameters
108  */
110  {
111  public:
112 
113  std::string m_rType; //!< Output raster data source type (as described in te::raster::RasterFactory ).
114 
115  std::map< std::string, std::string > m_rInfo; //!< The necessary information to create the output rasters (as described in te::raster::RasterFactory).
116 
117  std::unique_ptr< te::rst::Raster > m_outputRasterPtr; //!< The generated output registered raster.
118 
120 
122 
124 
125  //overload
126  void reset() ;
127 
128  //overload
129  const OutputParameters& operator=( const OutputParameters& params );
130 
131  //overload
132  AbstractParameters* clone() const;
133  };
134 
136 
138 
139  //overload
140  bool execute( AlgorithmOutputParameters& outputParams ) ;
141 
142  //overload
143  void reset() ;
144 
145  //overload
146  bool initialize( const AlgorithmInputParameters& inputParams ) ;
147 
148  bool isInitialized() const;
149 
150  protected:
151 
152  Register::InputParameters m_inputParameters; //!< Input execution parameters.
153 
154  bool m_isInitialized; //!< Tells if this instance is initialized.
155 
156 
157  };
158 
159  } // end namespace rp
160 } // end namespace te
161 
162 #endif
163 
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:52
2D Geometric transformation base class.
Raster Processing algorithm input parameters base interface.
Raster Processing algorithm output parameters base interface.
A class to standardize algorithm parameters serialization.
Raster Processing algorithm base interface.
Definition: Algorithm.h:42
Register input parameters.
Definition: Register.h:57
double m_outputResolutionX
The output raster X axis resolution (default:1).
Definition: Register.h:72
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
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
int m_outputSRID
The output raster SRID (default:0).
Definition: Register.h:70
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::rst::Raster const * m_inputRasterPtr
Input raster.
Definition: Register.h:64
bool m_enableProgress
Enable/Disable the progress interface (default:false).
Definition: Register.h:60
te::rst::Interpolator::Method m_interpMethod
The raster interpolator method (default:NearestNeighbor).
Definition: Register.h:76
const InputParameters & operator=(const InputParameters &params)
bool serialize(AlgorithmParametersSerializer &serializer) const
Returns a parameter serialization object.
double m_noDataValue
The pixel value used where no raster data is avaliable (defaul:0).
Definition: Register.h:78
double m_outputResolutionY
The output raster Y axis resolution (default:1).
Definition: Register.h:74
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
void reset()
Clear all internal allocated resources and reset the parameters instance to its initial state.
AbstractParameters * clone() const
Create a clone copy of this instance.
std::vector< unsigned int > m_inputRasterBands
Bands to process from the input raster.
Definition: Register.h:66
InputParameters(const InputParameters &)
Register output parameters.
Definition: Register.h:110
const OutputParameters & operator=(const OutputParameters &params)
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:115
AbstractParameters * clone() const
Create a clone copy of this instance.
void reset()
Clear all internal allocated resources and reset the parameters instance to its initial state.
std::string m_rType
Output raster data source type (as described in te::raster::RasterFactory ).
Definition: Register.h:113
std::unique_ptr< te::rst::Raster > m_outputRasterPtr
The generated output registered raster.
Definition: Register.h:117
OutputParameters(const OutputParameters &)
bool m_isInitialized
Tells if this instance is initialized.
Definition: Register.h:154
bool initialize(const AlgorithmInputParameters &inputParams)
Initialize the algorithm instance making it ready for execution.
bool isInitialized() const
Returns true if the algorithm instance is initialized and ready for execution.
void reset()
Clear all internal allocated objects and reset the algorithm to its initial state.
bool execute(AlgorithmOutputParameters &outputParams)
Executes the algorithm using the supplied parameters.
Register::InputParameters m_inputParameters
Input execution parameters.
Definition: Register.h:152
An abstract class for raster data strucutures.
Definition: Raster.h:72
InterpolationMethod
Allowed interpolation methods.
Definition: Enums.h:93
TerraLib.
#define TERPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:139
Abstract algorithm.