All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GeoMosaic.h
Go to the documentation of this file.
1 /* Copyright (C) 2001-2009 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  /*!
43  \class GeoMosaic
44  \brief Create a mosaic from a set of geo-referenced rasters.
45  \note The first raster will always be taken as reference to define the mosaic resolution and SRS.
46  \ingroup rp
47  */
49  {
50  public:
51 
52  /*!
53  \class InputParameters
54  \brief GeoMosaic input parameters
55  */
57  {
58  public:
59 
60  FeederConstRaster* m_feederRasterPtr; //!< Input rasters feeder.
61 
62  std::vector< std::vector< unsigned int > > m_inputRastersBands; //!< Bands to process for each input raster.
63 
64  te::rst::Interpolator::Method m_interpMethod; //!< The raster interpolator method (default:NearestNeighbor).
65 
66  double m_noDataValue; //!< The pixel value used where no raster data is avaliable (defaul:0).
67 
68  bool m_forceInputNoDataValue; //!< If true, m_noDataValue will be used as the no-data value for input rasters (defalt:false).
69 
70  te::rp::Blender::BlendMethod m_blendMethod; //!< The pixel blending method (default: NoBlendMethod).
71 
72  bool m_autoEqualize; //!< Auto equalization will be performed using the overlaped image areas (default:true).
73 
74  bool m_useRasterCache; //!< Enable(true) or disable the use of raster caching (default:true).
75 
77 
79 
80  ~InputParameters();
81 
82  //overload
83  void reset() throw( te::rp::Exception );
84 
85  //overload
86  const InputParameters& operator=( const InputParameters& params );
87 
88  //overload
89  AbstractParameters* clone() const;
90  };
91 
92  /*!
93  \class OutputParameters
94  \brief GeoMosaic output parameters
95  */
97  {
98  public:
99 
100  std::string m_rType; //!< Output raster data source type (as described in te::raster::RasterFactory ).
101 
102  std::map< std::string, std::string > m_rInfo; //!< The necessary information to create the output rasters (as described in te::raster::RasterFactory).
103 
104  std::auto_ptr< te::rst::Raster > m_outputRasterPtr; //!< The generated output mosaic raster.
105 
107 
109 
110  ~OutputParameters();
111 
112  //overload
113  void reset() throw( te::rp::Exception );
114 
115  //overload
116  const OutputParameters& operator=( const OutputParameters& params );
117 
118  //overload
119  AbstractParameters* clone() const;
120  };
121 
122  GeoMosaic();
123 
124  ~GeoMosaic();
125 
126  //overload
127  bool execute( AlgorithmOutputParameters& outputParams ) throw( te::rp::Exception );
128 
129  //overload
130  void reset() throw( te::rp::Exception );
131 
132  //overload
133  bool initialize( const AlgorithmInputParameters& inputParams ) throw( te::rp::Exception );
134 
135  bool isInitialized() const;
136 
137  protected:
138 
139  GeoMosaic::InputParameters m_inputParameters; //!< Input execution parameters.
140 
141  bool m_isInitialized; //!< Tells if this instance is initialized.
142 
143  /*!
144  \brief Execute a mosaic of georeferenced images.
145  \param outputParams The algorithm execution parameters.
146  \return true if ok, false on errors.
147  */
148  bool executeGeoMosaic( GeoMosaic::OutputParameters& outputParams );
149 
150 
151  /*!
152  \brief Raster band statistics calcule.
153  \param band Input raster band.
154  \param forceNoDataValue Force the noDataValue to be used as the band no-data value.
155  \param noDataValue The no-data value to use.
156  \param mean Pixels mean.
157  \param variance Pixels variance.
158  */
159  static void calcBandStatistics( const te::rst::Band& band,
160  const bool& forceNoDataValue,
161  const double& noDataValue,
162  double& mean,
163  double& variance );
164 
165  };
166 
167  } // end namespace rp
168 } // end namespace te
169 
170 #endif
171 
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:102
std::vector< std::vector< unsigned int > > m_inputRastersBands
Bands to process for each input raster.
Definition: GeoMosaic.h:62
Raster Processing algorithm base interface class.
GeoMosaic output parameters.
Definition: GeoMosaic.h:96
te::rst::Interpolator::Method m_interpMethod
The raster interpolator method (default:NearestNeighbor).
Definition: GeoMosaic.h:64
Raster Processing algorithm base interface.
Definition: Algorithm.h:42
Raster objects feeders.
Method
Allowed interpolation methods.
Definition: Interpolator.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:68
double m_noDataValue
The pixel value used where no raster data is avaliable (defaul:0).
Definition: GeoMosaic.h:66
std::auto_ptr< te::rst::Raster > m_outputRasterPtr
The generated output mosaic raster.
Definition: GeoMosaic.h:104
bool m_useRasterCache
Enable(true) or disable the use of raster caching (default:true).
Definition: GeoMosaic.h:74
bool m_autoEqualize
Auto equalization will be performed using the overlaped image areas (default:true).
Definition: GeoMosaic.h:72
FeederConstRaster * m_feederRasterPtr
Input rasters feeder.
Definition: GeoMosaic.h:60
Feeder from a input rasters.
Definition: FeedersRaster.h:45
Raster Processing algorithm output parameters base interface.
GeoMosaic input parameters.
Definition: GeoMosaic.h:56
Blended pixel value calculation for two overlaped rasters.
std::string m_rType
Output raster data source type (as described in te::raster::RasterFactory ).
Definition: GeoMosaic.h:100
te::rp::Blender::BlendMethod m_blendMethod
The pixel blending method (default: NoBlendMethod).
Definition: GeoMosaic.h:70
#define TERPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:91
Raster Processing algorithm input parameters base interface.
Create a mosaic from a set of geo-referenced rasters.
Definition: GeoMosaic.h:48