Loading...
Searching...
No Matches
Raster.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/memory/Raster.h
22
23 \brief A raster class for memory.
24*/
25
26#ifndef __TERRALIB_MEMORY_INTERNAL_RASTER_H
27#define __TERRALIB_MEMORY_INTERNAL_RASTER_H
28
29// TerraLib
30#include "../raster/Raster.h"
31#include "Config.h"
32
33namespace te
34{
35 namespace mem
36 {
37 /*!
38 \class Raster
39
40 \brief A raster class for memory.
41
42 \sa te::rst::Raster
43 */
45 {
46 public:
47
49
50 Raster(const Raster& rhs);
51
53
54 void open(const std::map<std::string, std::string>& rinfo, te::common::AccessPolicy p = te::common::RAccess);
55
56 std::map<std::string, std::string> getInfo() const;
57
58 std::size_t getNumberOfBands() const;
59
60 int getBandDataType(std::size_t i) const;
61
62 const te::rst::Band* getBand(std::size_t i) const;
63
64 te::rst::Band* getBand(std::size_t i);
65
66 const te::rst::Band& operator[](std::size_t i) const;
67
68 te::rst::Band& operator[](std::size_t i);
69
71
72 /*!
73 \note In-Memory driver extended method.
74 */
75 void close();
76
77 /*!
78 \note In-Memory driver extended method.
79 */
81 const std::vector<te::rst::BandProperty*> bands,
82 const std::map<std::string, std::string>& rinfo,
83 void* h, void (*deleter)(void*));
84
85 bool createMultiResolution( const unsigned int levels, const te::rst::InterpolationMethod interpMethod )
86 {
87 return false;
88 };
89
90 bool removeMultiResolution() { return false; };
91
92 unsigned int getMultiResLevelsCount() const
93 {
94 return 0;
95 }
96
97 te::rst::Raster* getMultiResLevel( const unsigned int level ) const
98 {
99 return 0;
100 }
101
102 private:
103
104 std::vector<te::rst::Band*> m_bands; //!< The list of data bands.
105 void (*m_deleter)(void*); //!< A pointer to a deleter function, if the buffer needs to be deleted by this object.
106 void* m_externalBuffer; //!< An external buffer.
107
108 /*!
109 \brief This instance info.
110 */
111 std::map<std::string, std::string> m_rasterInfo;
112
113 /*!
114 \brief update This instance raster info.
115 */
117 };
118
119 } // end namespace mem
120} // end namespace te
121
122#endif //__TERRALIB_MEMORY_INTERNAL_RASTER_H
A base class for values that can be retrieved from the data access module.
Definition: AbstractData.h:56
A raster class for memory.
Definition: Raster.h:45
void updateRasterInfo()
update This instance raster info.
te::dt::AbstractData * clone() const
It returns a clone of this object.
std::map< std::string, std::string > m_rasterInfo
This instance info.
Definition: Raster.h:111
std::vector< te::rst::Band * > m_bands
The list of data bands.
Definition: Raster.h:104
int getBandDataType(std::size_t i) const
Returns the data type in a particular band (or dimension).
const te::rst::Band & operator[](std::size_t i) const
Access band in i position.
const te::rst::Band * getBand(std::size_t i) const
Returns the raster i-th band.
~Raster()
Virtual destructor.
Raster(const Raster &rhs)
bool removeMultiResolution()
Remove/Destroy a sub-sampled multi-resolution pyramid, if there is one.
Definition: Raster.h:90
std::map< std::string, std::string > getInfo() const
It returns additional information about the raster.
void create(te::rst::Grid *g, const std::vector< te::rst::BandProperty * > bands, const std::map< std::string, std::string > &rinfo, void *h, void(*deleter)(void *))
unsigned int getMultiResLevelsCount() const
Returns the current number of multi-resolution pyramid levels.
Definition: Raster.h:92
void * m_externalBuffer
An external buffer.
Definition: Raster.h:106
te::rst::Band * getBand(std::size_t i)
Returns the raster i-th band.
bool createMultiResolution(const unsigned int levels, const te::rst::InterpolationMethod interpMethod)
Create a sub-sampled multi-resolution pyramid.
Definition: Raster.h:85
std::size_t getNumberOfBands() const
Returns the number of bands (dimension of cells attribute values) in the raster.
void open(const std::map< std::string, std::string > &rinfo, te::common::AccessPolicy p=te::common::RAccess)
Opens a raster.
te::rst::Band & operator[](std::size_t i)
Access band in i position.
te::rst::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: Raster.h:97
A raster band description.
Definition: Band.h:64
A rectified grid is the spatial support for raster data.
Definition: Grid.h:69
An abstract class for raster data strucutures.
Definition: Raster.h:72
AccessPolicy
Supported data access policies (can be used as bitfield).
Definition: Enums.h:41
@ RAccess
Definition: Enums.h:43
InterpolationMethod
Allowed interpolation methods.
Definition: Enums.h:93
TerraLib.
#define TEMEMORYEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:84
Proxy configuration file for TerraView (see terraview_config.h).