Reprojection.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/raster/Reprojection.h
22 
23  \brief It contains the algorithm to reproject raster data.
24 */
25 
26 #ifndef __TERRALIB_RASTER_INTERNAL_REPROJECTION_H
27 #define __TERRALIB_RASTER_INTERNAL_REPROJECTION_H
28 
29 // TerraLib
30 #include "Config.h"
31 #include "Interpolator.h"
32 
33 // STL
34 #include <map>
35 #include <string>
36 
37 namespace te
38 {
39 // Forward declarations
40  namespace gm { class Envelope; }
41  namespace srs { class Converter; }
42 
43  namespace rst
44  {
45  class Raster;
46 
47  /*!
48  \brief Reprojects a raster to another SRS.
49 
50  \param rin The input raster file. Do not pass a null pointer.
51  \param srid The target SRID for the reprojection.
52  \param routinfo The basic parameters necessary to create the reprojected raster.
53  \param m The method of interpolation to apply. \sa te::rst::Interpolator
54 
55  \return A pointer to the raster reprojected if success or a null pointer otherwise.
56 
57  \exception Exception This function might through an exception if the coordinate conversion fails.
58 
59  \note The caller will take the ownership of the returned pointer.
60  */
61  TERASTEREXPORT te::rst::Raster* Reproject(te::rst::Raster const * const rin, int srid, const std::map<std::string, std::string>& routinfo, int m = te::rst::NearestNeighbor);
62 
63  /*!
64  \brief Reprojects a portion of a raster to another SRS.
65 
66  \param rin The input raster file. Do not pass a null pointer.
67  \param srid The target SRID for the reprojection.
68  \param llx Lower-left X-coordinate of the portion to be reprojected (in the original SRS).
69  \param lly Lower-left Y-coordinate of the portion to be reprojected (in the original SRS).
70  \param urx Upper-Right X-coordinate of the portion to be reprojected (in the original SRS).
71  \param ury Upper-Right Y-coordinate of the portion to be reprojected (in the original SRS).
72  \param routinfo The basic parameters necessary to create the reprojected raster.
73  \param m The method of interpolation to apply. \sa te::rst::Interpolator
74 
75  \return A pointer to the raster reprojected if success or a null pointer otherwise.
76 
77  \exception Exception This function might through an exception if the coordinate conversion fails.
78 
79  \note The caller will take the ownership of the returned pointer.
80  */
81  TERASTEREXPORT te::rst::Raster* Reproject(te::rst::Raster const * const rin, int srid, double llx, double lly, double urx, double ury, const std::map<std::string, std::string>& routinfo, int m = te::rst::NearestNeighbor);
82 
83  /*!
84  \brief Reprojects a portion of a raster to another SRS and maintaining a given resolution.
85 
86  \param rin The input raster file. Do not pass a null pointer.
87  \param srid The target SRID for the reprojection.
88  \param llx Lower-left X-coordinate of the portion to be reprojected (in the original SRS).
89  \param lly Lower-left Y-coordinate of the portion to be reprojected (in the original SRS).
90  \param urx Upper-Right X-coordinate of the portion to be reprojected (in the original SRS).
91  \param ury Upper-Right Y-coordinate of the portion to be reprojected (in the original SRS).
92  \param resx The output x resolution (in units of the target SRS - if resx=0 the number of columns will be kept the same).
93  \param resy The output y resolution (in units of the target SRS - if resy=0 the number of rows will be kept the same).
94  \param routinfo The basic parameters necessary to create the reprojected raster.
95  \param m The method of interpolation to apply. \sa te::rst::Interpolator
96 
97  \return A pointer to the raster reprojected if success or a null pointer otherwise.
98 
99  \exception Exception This function might through an exception if the coordinate conversion fails.
100 
101  \note The caller will take the ownership of the returned pointer.
102  */
103  TERASTEREXPORT te::rst::Raster* Reproject(te::rst::Raster const * const rin, int srid, double llx, double lly, double urx, double ury, double resx, double resy, const std::map<std::string, std::string>& routinfo, int m = te::rst::NearestNeighbor);
104  }
105 }
106 
107 #endif // __TERRALIB_RASTER_INTERNAL_REPROJECTION_H
#define TERASTEREXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:62
Near neighborhood interpolation method.
Definition: Enums.h:95
TERASTEREXPORT te::rst::Raster * Reproject(te::rst::Raster const *const rin, int srid, const std::map< std::string, std::string > &routinfo, int m=te::rst::NearestNeighbor)
Reprojects a raster to another SRS.
An abstract class for raster data strucutures.
Definition: Raster.h:71
URI C++ Library.
A Converter is responsible for the conversion of coordinates between different Coordinate Systems (CS...
Definition: Converter.h:53
Configuration flags for the Raster module of TerraLib.
It interpolates one pixel based on a selected algorithm.