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  te::rst::Raster const* m_inputRasterPtr; //!< Input raster.
61 
62  std::vector< unsigned int > m_inputRasterBands; //!< Bands to process from the input raster.
63 
64  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).
65 
66  int m_outputSRID; //!< The output raster SRID (default:0).
67 
68  double m_outputResolutionX; //!< The output raster X axis resolution (default:1).
69 
70  double m_outputResolutionY; //!< The output raster Y axis resolution (default:1).
71 
72  te::rst::Interpolator::Method m_interpMethod; //!< The raster interpolator method (default:NearestNeighbor).
73 
74  double m_noDataValue; //!< The pixel value used where no raster data is avaliable (defaul:0).
75 
76  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).
77 
78  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).
79 
80  te::gm::Envelope m_outputBoundingBox; //!< An optional bounding box (under the chosen SRS) to use for the generated output raster (default: automatically calculated).
81 
83 
85 
86  ~InputParameters();
87 
88  //overload
89  void reset() throw( te::rp::Exception );
90 
91  //overload
92  const InputParameters& operator=( const InputParameters& params );
93 
94  //overload
95  AbstractParameters* clone() const;
96  };
97 
98  /*!
99  \class OutputParameters
100  \brief Register output parameters
101  */
103  {
104  public:
105 
106  std::string m_rType; //!< Output raster data source type (as described in te::raster::RasterFactory ).
107 
108  std::map< std::string, std::string > m_rInfo; //!< The necessary information to create the output rasters (as described in te::raster::RasterFactory).
109 
110  std::auto_ptr< te::rst::Raster > m_outputRasterPtr; //!< The generated output registered raster.
111 
113 
115 
116  ~OutputParameters();
117 
118  //overload
119  void reset() throw( te::rp::Exception );
120 
121  //overload
122  const OutputParameters& operator=( const OutputParameters& params );
123 
124  //overload
125  AbstractParameters* clone() const;
126  };
127 
128  Register();
129 
130  ~Register();
131 
132  //overload
133  bool execute( AlgorithmOutputParameters& outputParams ) throw( te::rp::Exception );
134 
135  //overload
136  void reset() throw( te::rp::Exception );
137 
138  //overload
139  bool initialize( const AlgorithmInputParameters& inputParams ) throw( te::rp::Exception );
140 
141  bool isInitialized() const;
142 
143  protected:
144 
145  Register::InputParameters m_inputParameters; //!< Input execution parameters.
146 
147  bool m_isInitialized; //!< Tells if this instance is initialized.
148 
149 
150  };
151 
152  } // end namespace rp
153 } // end namespace te
154 
155 #endif
156 
Register input parameters.
Definition: Register.h:56
te::rst::Raster const * m_inputRasterPtr
Input raster.
Definition: Register.h:60
Base exception class for plugin module.
Definition: Exception.h:42
Raster Processing algorithm output parameters base interface.
2D Geometric transformation base class.
Raster Processing algorithm base interface class.
double m_outputResolutionY
The output raster Y axis resolution (default:1).
Definition: Register.h:70
InterpolationMethod
Allowed interpolation methods.
Definition: Enums.h:92
te::gm::GeometricTransformation const * m_geomTransfPtr
An optional pointer to a valid geometric transformation instance (direct mapping raster lines/columns...
Definition: Register.h:78
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:64
Raster Processing algorithm base interface.
Definition: Algorithm.h:41
double m_noDataValue
The pixel value used where no raster data is avaliable (defaul:0).
Definition: Register.h:74
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
An abstract class for raster data strucutures.
Definition: Raster.h:71
std::vector< unsigned int > m_inputRasterBands
Bands to process from the input raster.
Definition: Register.h:62
te::rst::Interpolator::Method m_interpMethod
The raster interpolator method (default:NearestNeighbor).
Definition: Register.h:72
URI C++ Library.
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:108
#define TERPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:139
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:80
std::auto_ptr< te::rst::Raster > m_outputRasterPtr
The generated output registered raster.
Definition: Register.h:110
Performs raster data registering into a SRS using a set of tie points.
Definition: Register.h:48
int m_outputSRID
The output raster SRID (default:0).
Definition: Register.h:66
double m_outputResolutionX
The output raster X axis resolution (default:1).
Definition: Register.h:68
Register output parameters.
Definition: Register.h:102
Raster Processing algorithm input parameters base interface.
std::string m_rType
Output raster data source type (as described in te::raster::RasterFactory ).
Definition: Register.h:106
std::string m_geomTransfName
The name of the geometric transformation used (see each te::gm::GTFactory inherited classes to find e...
Definition: Register.h:76