RasterManager.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/tools/rastermanager/core/RasterManager.h
22 
23  \brief Terralib Raster Manager Tool
24 */
25 
26 #ifndef __TERRALIB_TOOLS_RASTERMANAGER_RASTERMANAGER_H
27 #define __TERRALIB_TOOLS_RASTERMANAGER_RASTERMANAGER_H
28 
29 // STL
30 #include <string>
31 #include <vector>
32 
33 namespace te
34 {
35  namespace tools
36  {
37  namespace rastermanager
38  {
39  /*!
40  \class RasterManager
41 
42  \brief Class with methods to manage and manipulate rasters
43  */
45  {
46  public:
47 
48  RasterManager();
49 
50  /*!
51  \brief Init the application
52 
53  \param input Input raster path
54  \param errorMessage String that receive methods errors description
55 
56  \return True if successfully
57  */
58  bool init(std::string input, std::string & errorMessage);
59 
60  /*!
61  \brief Copy a raster
62 
63  \param output Output raster path
64  \param bandVec Integer vector with the bands to copy
65  \param bandType Define witch type the output raster will have
66  \param errorMessage String that receive methods errors description
67 
68  \return True if successfully
69  */
70  bool copyRaster(std::string output, std::vector<int> bandVec, int bandType, std::string & errorMessage);
71 
72  /*!
73  \brief Show raster informations
74 
75  \param output Buffer with the informations
76  \param errorMessage String that receive methods errors description
77 
78  \return True if successfully
79  */
80  bool getRasterInfo(std::ostringstream & output, std::string & errorMessage);
81 
82  /*!
83  \brief Reproject a raster
84 
85  \param output Output raster path
86  \param srid Srid code to resproject
87  \param errorMessage String that receive methods errors description
88 
89  \return True if successfully
90  */
91  bool reproject(std::string output, int srid, std::string & errorMessage);
92 
93  /*!
94  \brief Convert a raster
95 
96  \param output Output raster path
97  \param extension String with the extrenson to convert
98  \param bandVec Integer vector with the bands to copy
99  \param errorMessage String that receive methods errors description
100 
101  \return True if successfully
102  */
103  bool convert(std::string output, std::string extension, std::vector<int> bandVec, std::string & errorMessage);
104 
105  /*!
106  \brief Change Raster resolution
107 
108  \param output Output raster path
109  \param method Integer with the method used to change the resolution
110  1 for Nearest Neighbor method
111  2 for Bilinear method
112  3 for Bicubic method
113  \param errorMessage String that receive methods errors description
114 
115  \return True if successfully
116  */
117  bool changeResolution(std::string output, int method,int scale, std::string & errorMessage);
118 
119  /*!
120  \brief Trim a raster
121 
122  \param output Output raster path
123  \param env Double vector with the new envelope (box)
124  \param errorMessage String that receive methods errors description
125 
126  \return True if successfully
127  */
128  bool trim(std::string output, std::vector<double> env, std::string & errorMessage);
129 
130  /*!
131  \brief Show Supported Extensions
132 
133  \param errorMessage String that receive methods errors description
134 
135  \return True if successfully
136  */
137  bool showSupportedExtensions(std::string & errorMessage);
138 
139  /*!
140  \brief Get Supported Extensions
141 
142  \param extents String vector with the supported extensions
143  \param errorMessage String that receive methods errors description
144 
145  \return True if successfully
146  */
147  bool getSupportedExtensions(std::vector<std::string> & extents, std::string & errorMessage);
148 
149  private:
150 
151  std::string m_input; //!< The input raster path
153 
154  };
155  }
156  }
157 }
158 
159 #endif // __TERRALIB_TOOLS_RASTERMANAGER_RASTERMANAGER_H
bool reproject(std::string output, int srid, std::string &errorMessage)
Reproject a raster.
Class with methods to manage and manipulate rasters.
Definition: RasterManager.h:44
bool showSupportedExtensions(std::string &errorMessage)
Show Supported Extensions.
URI C++ Library.
bool getSupportedExtensions(std::vector< std::string > &extents, std::string &errorMessage)
Get Supported Extensions.
bool getRasterInfo(std::ostringstream &output, std::string &errorMessage)
Show raster informations.
bool trim(std::string output, std::vector< double > env, std::string &errorMessage)
Trim a raster.
bool convert(std::string output, std::string extension, std::vector< int > bandVec, std::string &errorMessage)
Convert a raster.
bool init(std::string input, std::string &errorMessage)
Init the application.
std::string m_input
The input raster path.
bool copyRaster(std::string output, std::vector< int > bandVec, int bandType, std::string &errorMessage)
Copy a raster.
bool changeResolution(std::string output, int method, int scale, std::string &errorMessage)
Change Raster resolution.