GeoMosaic.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/GeoMosaic.h
22  \brief Create a mosaic from a set of geo-referenced rasters.
23  */
24 
25 #ifndef __TERRALIB_RP_INTERNAL_GEOMOSAIC_H
26 #define __TERRALIB_RP_INTERNAL_GEOMOSAIC_H
27 
28 #include "Algorithm.h"
29 #include "FeedersRaster.h"
30 #include "Blender.h"
31 #include "../raster/Interpolator.h"
32 
33 #include <vector>
34 #include <string>
35 #include <map>
36 #include <memory>
37 
38 namespace te
39 {
40  namespace rp
41  {
42  class GeoComposition;
43 
44  /*!
45  \class GeoMosaic
46  \brief Create a mosaic from a set of geo-referenced rasters.
47  \ingroup rp_mos
48  */
50  {
51  public:
52 
53  /*!
54  \class InputParameters
55  \brief GeoMosaic input parameters
56  */
58  {
59  public:
60 
61  friend class GeoMosaic;
62  friend class GeoComposition;
63 
64  /*! \enum EqType The mosaic equalization type.*/
65  enum EqType
66  {
67  InvalidEqType = 0, //!< Invalid equalization type.
68  NoEqType = 1, //!< No equalization performed.
69  CenterEqType = 2, //!< Mosaic will be equalized following the center raster.
70  TargetEqtype = 3, //!< Mosaic will be equalized following the supplied target means (m_mosaicTargetMeans) and std devs (m_mosaicTargetStdDevs).
71  LocalEqType = 4 //!< Mosaic will be equalized following a local strategy.
72  };
73 
74  FeederConstRaster* m_feederRasterPtr; //!< Input rasters feeder.
75 
76  std::vector< std::vector< unsigned int > > m_inputRastersBands; //!< Bands to process for each input raster.
77 
78  te::rst::Interpolator::Method m_interpMethod; //!< The raster interpolator method (default:NearestNeighbor).
79 
80  double m_noDataValue; //!< The pixel value used where no raster data is avaliable (defaul:0).
81 
82  bool m_forceInputNoDataValue; //!< If true, m_noDataValue will be used as the no-data value for input rasters (defalt:false).
83 
84  te::rp::Blender::BlendMethod m_blendMethod; //!< The pixel blending method (default: NoBlendMethod).
85 
86  EqType m_equalizationType; //!< Equalization type (default:CenterEqType ).
87 
88  bool m_useRasterCache; //!< Enable(true) or disable the use of raster caching (default:true).
89 
90  bool m_enableProgress; //!< Enable/Disable the progress interface (default:false).
91 
92  bool m_enableMultiThread; //!< Enable/disable the use of threads (default:true).
93 
94  bool m_enableAutoValidAreaDetect; //!< Enable/disable the auto-detection of raster valid area pixels (this option allows better mosaic result for rasters with no-data pixels on borders. Default:true).
95 
96  std::vector< double > m_mosaicTargetMeans; //!< An empty vector for automatic mosaic target means calcule or a vector of target means for each mosaic baind.
97 
98  std::vector< double > m_mosaicTargetStdDevs; //!< An empty vector for automatic mosaic target standart deviation values calcule or a vector of target standart deviantion values for each mosaic baind.
99 
100  bool m_abortOnFirstError; //!< if true the processing will be stopped on the first error, if false the processing of the next rasters will continue on the event of an error (default: true).
101 
102  bool m_skipInsideRasters; //!< Rasters covering mosaic areas already covered by other rasters will be skipped (default: false).
103 
105 
107 
109 
110  //overload
111  void reset() _NOEXCEPT_OP(false);
112 
113  //overload
114  const InputParameters& operator=( const InputParameters& params );
115 
116  //overload
117  AbstractParameters* clone() const;
118 
119  //overload
120  bool serialize ( AlgorithmParametersSerializer& serializer ) const;
121 
122  protected :
123 
124  BlenderRule const * m_blenderRulePtr;
125  };
126 
127  /*!
128  \class OutputParameters
129  \brief GeoMosaic output parameters
130  */
132  {
133  public:
134 
135  std::string m_rType; //!< Output raster data source type (as described in te::raster::RasterFactory ).
136 
137  std::map< std::string, std::string > m_rInfo; //!< The necessary information to create the output rasters (as described in te::raster::RasterFactory).
138 
139  std::unique_ptr< te::rst::Raster > m_outputRasterPtr; //!< The generated output mosaic raster.
140 
142 
144 
146 
147  //overload
148  void reset() _NOEXCEPT_OP(false);
149 
150  //overload
151  const OutputParameters& operator=( const OutputParameters& params );
152 
153  //overload
154  AbstractParameters* clone() const;
155  };
156 
158 
160 
161  //overload
162  bool execute( AlgorithmOutputParameters& outputParams ) _NOEXCEPT_OP(false);
163 
164  //overload
165  void reset() _NOEXCEPT_OP(false);
166 
167  //overload
168  bool initialize( const AlgorithmInputParameters& inputParams ) _NOEXCEPT_OP(false);
169 
170  bool isInitialized() const;
171 
172  protected:
173 
174  GeoMosaic::InputParameters m_inputParameters; //!< Input execution parameters.
175 
176  bool m_isInitialized; //!< Tells if this instance is initialized.
177 
178  };
179 
180  } // end namespace rp
181 } // end namespace te
182 
183 #endif
184 
Blended pixel value calculation for two overlaped rasters.
Raster objects feeders.
#define _NOEXCEPT_OP(x)
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
Feeder from a input rasters.
Definition: FeedersRaster.h:47
GeoMosaic input parameters.
Definition: GeoMosaic.h:58
bool m_forceInputNoDataValue
If true, m_noDataValue will be used as the no-data value for input rasters (defalt:false).
Definition: GeoMosaic.h:82
te::rst::Interpolator::Method m_interpMethod
The raster interpolator method (default:NearestNeighbor).
Definition: GeoMosaic.h:78
EqType m_equalizationType
Equalization type (default:CenterEqType ).
Definition: GeoMosaic.h:86
std::vector< double > m_mosaicTargetMeans
An empty vector for automatic mosaic target means calcule or a vector of target means for each mosaic...
Definition: GeoMosaic.h:96
bool m_skipInsideRasters
Rasters covering mosaic areas already covered by other rasters will be skipped (default: false).
Definition: GeoMosaic.h:102
bool m_enableProgress
Enable/Disable the progress interface (default:false).
Definition: GeoMosaic.h:90
FeederConstRaster * m_feederRasterPtr
Input rasters feeder.
Definition: GeoMosaic.h:74
InputParameters(const InputParameters &)
bool m_abortOnFirstError
if true the processing will be stopped on the first error, if false the processing of the next raster...
Definition: GeoMosaic.h:100
te::rp::Blender::BlendMethod m_blendMethod
The pixel blending method (default: NoBlendMethod).
Definition: GeoMosaic.h:84
double m_noDataValue
The pixel value used where no raster data is avaliable (defaul:0).
Definition: GeoMosaic.h:80
bool m_enableMultiThread
Enable/disable the use of threads (default:true).
Definition: GeoMosaic.h:92
void reset() _NOEXCEPT_OP(false)
Clear all internal allocated resources and reset the parameters instance to its initial state.
bool m_enableAutoValidAreaDetect
Enable/disable the auto-detection of raster valid area pixels (this option allows better mosaic resul...
Definition: GeoMosaic.h:94
std::vector< std::vector< unsigned int > > m_inputRastersBands
Bands to process for each input raster.
Definition: GeoMosaic.h:76
bool m_useRasterCache
Enable(true) or disable the use of raster caching (default:true).
Definition: GeoMosaic.h:88
std::vector< double > m_mosaicTargetStdDevs
An empty vector for automatic mosaic target standart deviation values calcule or a vector of target s...
Definition: GeoMosaic.h:98
GeoMosaic output parameters.
Definition: GeoMosaic.h:132
std::string m_rType
Output raster data source type (as described in te::raster::RasterFactory ).
Definition: GeoMosaic.h:135
std::map< std::string, std::string > m_rInfo
The necessary information to create the output rasters (as described in te::raster::RasterFactory).
Definition: GeoMosaic.h:137
OutputParameters(const OutputParameters &)
std::unique_ptr< te::rst::Raster > m_outputRasterPtr
The generated output mosaic raster.
Definition: GeoMosaic.h:139
void reset() _NOEXCEPT_OP(false)
Clear all internal allocated resources and reset the parameters instance to its initial state.
Create a mosaic from a set of geo-referenced rasters.
Definition: GeoMosaic.h:50
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.