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  FeederConstRaster* m_feederRasterPtr; //!< Input rasters feeder.
65 
66  std::vector< std::vector< unsigned int > > m_inputRastersBands; //!< Bands to process for each input raster.
67 
68  te::rst::Interpolator::Method m_interpMethod; //!< The raster interpolator method (default:NearestNeighbor).
69 
70  double m_noDataValue; //!< The pixel value used where no raster data is avaliable (defaul:0).
71 
72  bool m_forceInputNoDataValue; //!< If true, m_noDataValue will be used as the no-data value for input rasters (defalt:false).
73 
74  te::rp::Blender::BlendMethod m_blendMethod; //!< The pixel blending method (default: NoBlendMethod).
75 
76  bool m_autoEqualize; //!< Auto equalization will be performed using the overlaped image areas (default:true).
77 
78  bool m_useRasterCache; //!< Enable(true) or disable the use of raster caching (default:true).
79 
80  bool m_enableProgress; //!< Enable/Disable the progress interface (default:false).
81 
82  bool m_enableMultiThread; //!< Enable/disable the use of threads (default:true).
83 
84  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).
85 
86  std::vector< double > m_mosaicTargetMeans; //!< An empty vector for automatic mosaic target means calcule or a vector of target means for each mosaic baind.
87 
88  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.
89 
90  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).
91 
92  bool m_skipInsideRasters; //!< Rasters covering mosaic areas already covered by other rasters will be skipped (default: false).
93 
95 
97 
99 
100  //overload
101  void reset() _NOEXCEPT_OP(false);
102 
103  //overload
104  const InputParameters& operator=( const InputParameters& params );
105 
106  //overload
107  AbstractParameters* clone() const;
108 
109  protected :
110 
111  BlenderRule const * m_blenderRulePtr;
112  };
113 
114  /*!
115  \class OutputParameters
116  \brief GeoMosaic output parameters
117  */
119  {
120  public:
121 
122  std::string m_rType; //!< Output raster data source type (as described in te::raster::RasterFactory ).
123 
124  std::map< std::string, std::string > m_rInfo; //!< The necessary information to create the output rasters (as described in te::raster::RasterFactory).
125 
126  std::unique_ptr< te::rst::Raster > m_outputRasterPtr; //!< The generated output mosaic raster.
127 
129 
131 
133 
134  //overload
135  void reset() _NOEXCEPT_OP(false);
136 
137  //overload
138  const OutputParameters& operator=( const OutputParameters& params );
139 
140  //overload
141  AbstractParameters* clone() const;
142  };
143 
145 
147 
148  //overload
149  bool execute( AlgorithmOutputParameters& outputParams ) _NOEXCEPT_OP(false);
150 
151  //overload
152  void reset() _NOEXCEPT_OP(false);
153 
154  //overload
155  bool initialize( const AlgorithmInputParameters& inputParams ) _NOEXCEPT_OP(false);
156 
157  bool isInitialized() const;
158 
159  protected:
160 
161  GeoMosaic::InputParameters m_inputParameters; //!< Input execution parameters.
162 
163  bool m_isInitialized; //!< Tells if this instance is initialized.
164 
165  };
166 
167  } // end namespace rp
168 } // end namespace te
169 
170 #endif
171 
te::rp::GeoMosaic::OutputParameters::reset
void reset() _NOEXCEPT_OP(false)
Clear all internal allocated resources and reset the parameters instance to its initial state.
te
TerraLib.
Definition: AddressGeocodingOp.h:52
te::rp::AlgorithmOutputParameters
Raster Processing algorithm output parameters base interface.
Definition: AlgorithmOutputParameters.h:40
te::rp::GeoMosaic::InputParameters::~InputParameters
~InputParameters()
te::rp::GeoMosaic::InputParameters::m_inputRastersBands
std::vector< std::vector< unsigned int > > m_inputRastersBands
Bands to process for each input raster.
Definition: GeoMosaic.h:66
te::rp::GeoMosaic
Create a mosaic from a set of geo-referenced rasters.
Definition: GeoMosaic.h:50
te::rp::AlgorithmInputParameters
Raster Processing algorithm input parameters base interface.
Definition: AlgorithmInputParameters.h:40
te::rp::blender::BlendMethod
BlendMethod
Definition: BlenderTypeDefs.h:33
te::rp::GeoMosaic::InputParameters::m_skipInsideRasters
bool m_skipInsideRasters
Rasters covering mosaic areas already covered by other rasters will be skipped (default: false).
Definition: GeoMosaic.h:92
te::rp::FeederConstRaster
Feeder from a input rasters.
Definition: FeedersRaster.h:47
_NOEXCEPT_OP
#define _NOEXCEPT_OP(x)
Definition: NoExceptDefinition.h:36
te::rp::GeoMosaic::InputParameters::m_noDataValue
double m_noDataValue
The pixel value used where no raster data is avaliable (defaul:0).
Definition: GeoMosaic.h:70
te::rp::GeoMosaic::InputParameters::m_mosaicTargetMeans
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:86
te::rp::GeoMosaic::OutputParameters::~OutputParameters
~OutputParameters()
te::rp::GeoMosaic::OutputParameters::m_outputRasterPtr
std::unique_ptr< te::rst::Raster > m_outputRasterPtr
The generated output mosaic raster.
Definition: GeoMosaic.h:126
te::rp::Algorithm
Raster Processing algorithm base interface.
Definition: Algorithm.h:42
FeedersRaster.h
Raster objects feeders.
te::rp::GeoMosaic::InputParameters::m_enableMultiThread
bool m_enableMultiThread
Enable/disable the use of threads (default:true).
Definition: GeoMosaic.h:82
te::rst::InterpolationMethod
InterpolationMethod
Allowed interpolation methods.
Definition: Enums.h:93
te::rp::GeoMosaic::InputParameters::m_forceInputNoDataValue
bool m_forceInputNoDataValue
If true, m_noDataValue will be used as the no-data value for input rasters (defalt:false).
Definition: GeoMosaic.h:72
te::rp::GeoMosaic::OutputParameters::m_rType
std::string m_rType
Output raster data source type (as described in te::raster::RasterFactory ).
Definition: GeoMosaic.h:122
te::rp::GeoMosaic::InputParameters::m_interpMethod
te::rst::Interpolator::Method m_interpMethod
The raster interpolator method (default:NearestNeighbor).
Definition: GeoMosaic.h:68
te::rp::GeoMosaic::InputParameters::m_autoEqualize
bool m_autoEqualize
Auto equalization will be performed using the overlaped image areas (default:true).
Definition: GeoMosaic.h:76
Blender.h
Blended pixel value calculation for two overlaped rasters.
te::rp::GeoMosaic::OutputParameters
GeoMosaic output parameters.
Definition: GeoMosaic.h:119
te::rp::GeoMosaic::InputParameters::reset
void reset() _NOEXCEPT_OP(false)
Clear all internal allocated resources and reset the parameters instance to its initial state.
te::rp::GeoMosaic::InputParameters::InputParameters
InputParameters(const InputParameters &)
te::rp::GeoMosaic::InputParameters::m_mosaicTargetStdDevs
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:88
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::GeoMosaic::InputParameters
GeoMosaic input parameters.
Definition: GeoMosaic.h:58
te::rp::GeoMosaic::InputParameters::m_useRasterCache
bool m_useRasterCache
Enable(true) or disable the use of raster caching (default:true).
Definition: GeoMosaic.h:78
te::rp::GeoMosaic::InputParameters::m_feederRasterPtr
FeederConstRaster * m_feederRasterPtr
Input rasters feeder.
Definition: GeoMosaic.h:64
te::rp::GeoMosaic::OutputParameters::OutputParameters
OutputParameters()
Algorithm.h
Abstract algorithm.
te::rp::BlenderRule
Definition: BlenderRule.h:45
te::rp::GeoMosaic::InputParameters::InputParameters
InputParameters()
te::rp::GeoMosaic::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: GeoMosaic.h:124
te::rp::GeoMosaic::InputParameters::m_abortOnFirstError
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:90
te::rp::GeoMosaic::InputParameters::m_enableProgress
bool m_enableProgress
Enable/Disable the progress interface (default:false).
Definition: GeoMosaic.h:80
te::rp::GeoMosaic::OutputParameters::OutputParameters
OutputParameters(const OutputParameters &)
te::rp::GeoMosaic::InputParameters::m_blendMethod
te::rp::Blender::BlendMethod m_blendMethod
The pixel blending method (default: NoBlendMethod).
Definition: GeoMosaic.h:74
te::rp::GeoMosaic::InputParameters::m_enableAutoValidAreaDetect
bool m_enableAutoValidAreaDetect
Enable/disable the auto-detection of raster valid area pixels (this option allows better mosaic resul...
Definition: GeoMosaic.h:84