ProxyRaster.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/ProxyRaster.h
22 
23  \brief A proxy class for bands of several rasters over the same region.
24 */
25 
26 #ifndef __TERRALIB_RASTER_INTERNAL_PROXYRASTER_H
27 #define __TERRALIB_RASTER_INTERNAL_PROXYRASTER_H
28 
29 // TerraLib
30 #include "Raster.h"
31 
32 namespace te
33 {
34  namespace rst
35  {
36  /*!
37  \class ProxyRaster
38 
39  \brief A proxy class for bands of several rasters over the same region.
40 
41  \ingroup rst
42  */
44  {
45  public:
46 
47  /*!
48  \brief Constructor from a set of rasters.
49 
50  The bands of the proxy raster will be taken from the input set of raster.
51 
52  \param rasters A vector with the list of raster covering the same region.
53 
54  \pre All rasters must cover the same region, have the same grid parameters.
55 
56  \note It is desired, but not required, that all raster have the same block size.
57  */
58  ProxyRaster(const std::vector<RasterPtr>& rasters);
59 
60  /*!
61  \brief Copy constructor.
62 
63  \param rhs The right-hand side Raster.
64  */
65  ProxyRaster(const ProxyRaster& rhs);
66 
67  /*! \brief Destructor. */
68  ~ProxyRaster();
69 
70  void swap(std::size_t first, std::size_t second);
71 
72  void open(const std::map<std::string, std::string>& rinfo, te::common::AccessPolicy p = te::common::RAccess);
73 
74  std::map<std::string, std::string> getInfo() const;
75 
76  std::size_t getNumberOfBands() const;
77 
78  int getBandDataType(std::size_t i) const;
79 
80  const Band* getBand(std::size_t i) const;
81 
82  Band* getBand(std::size_t i);
83 
84  const Band& operator[](std::size_t i) const;
85 
86  Band& operator[](std::size_t i);
87 
88  te::dt::AbstractData* clone() const { return 0; }
89 
90  bool createMultiResolution( const unsigned int levels, const InterpolationMethod interpMethod )
91  {
92  return false;
93  };
94 
95  bool removeMultiResolution() { return false; };
96 
97  unsigned int getMultiResLevelsCount() const
98  {
99  return 0;
100  }
101 
102  Raster* getMultiResLevel( const unsigned int level ) const
103  {
104  return 0;
105  }
106 
107  protected:
108 
109  std::vector<RasterPtr> m_rasters; //!< The list of proxed rasters.
110  std::vector<Band*> m_bands; //!< The proxy raster bands.
111  std::map<std::string, std::string> m_rinfo; //!< Proxy raster additional information.
112  };
113 
114  typedef boost::shared_ptr<ProxyRaster> ProxyRasterPtr;
115 
116  } // end namespace rst
117 } // end namespace te
118 
119 #endif //__TERRALIB_RASTER_INTERNAL_PROXYRASTER_H
#define TERASTEREXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:62
Raster * getMultiResLevel(const unsigned int level) const
Returns the required level of a multi-resolution pyramid or NULL if that level does not exists...
Definition: ProxyRaster.h:102
bool removeMultiResolution()
Remove/Destroy a sub-sampled multi-resolution pyramid, if there is one.
Definition: ProxyRaster.h:95
boost::shared_ptr< ProxyRaster > ProxyRasterPtr
Definition: ProxyRaster.h:114
InterpolationMethod
Allowed interpolation methods.
Definition: Enums.h:92
bool createMultiResolution(const unsigned int levels, const InterpolationMethod interpMethod)
Create a sub-sampled multi-resolution pyramid.
Definition: ProxyRaster.h:90
std::map< std::string, std::string > m_rinfo
Proxy raster additional information.
Definition: ProxyRaster.h:111
unsigned int getMultiResLevelsCount() const
Returns the current number of multi-resolution pyramid levels.
Definition: ProxyRaster.h:97
std::vector< RasterPtr > m_rasters
The list of proxed rasters.
Definition: ProxyRaster.h:109
AccessPolicy
Supported data access policies (can be used as bitfield).
Definition: Enums.h:40
An abstract class for raster data strucutures.
An abstract class for raster data strucutures.
Definition: Raster.h:71
std::vector< Band * > m_bands
The proxy raster bands.
Definition: ProxyRaster.h:110
URI C++ Library.
A base class for values that can be retrieved from the data access module.
Definition: AbstractData.h:57
A raster band description.
Definition: Band.h:63
A proxy class for bands of several rasters over the same region.
Definition: ProxyRaster.h:43
te::dt::AbstractData * clone() const
It returns a clone of this object.
Definition: ProxyRaster.h:88