27 #include "../../../datatype/AbstractData.h"
28 #include "../../../datatype/SimpleData.h"
29 #include "../../../geometry/Geometry.h"
30 #include "../../../geometry/Point.h"
31 #include "../../../geometry/Utils.h"
32 #include "../../../raster/RasterProperty.h"
33 #include "../../../raster/Grid.h"
34 #include "../../../raster/PositionIterator.h"
37 #include <boost/shared_ptr.hpp>
38 #include <boost/ptr_container/ptr_vector.hpp>
62 for(std::size_t i=0; i<
m_raster->getNumberOfBands(); ++i)
75 for(std::size_t i=0; i<m_raster->getNumberOfBands(); ++i)
76 m_ptypes.push_back(m_raster->getBandDataType(i));
81 return m_raster.get();
92 static_cast<te::dt::DateTime*>(m_time->clone()));
102 return m_sextent.get();
112 return m_raster->getNumberOfBands();
127 std::vector<double> aux;
129 for(
unsigned int i = 0; i<aux.size(); ++i)
137 return std::auto_ptr<te::dt::AbstractData>(
new te::dt::Double(result));
141 boost::ptr_vector<te::dt::AbstractData>& result)
const
147 double value = it[p];
148 result.push_back(std::auto_ptr<te::dt::AbstractData> (
new te::dt::Double(value)));
155 boost::ptr_vector<te::dt::AbstractData>& result)
const
161 std::vector<double> values = *it;
162 for(
unsigned int i=0; i<values.size(); ++i)
163 result.push_back(std::auto_ptr<te::dt::AbstractData> (
new te::dt::Double(values[i])));
171 std::vector<double> aux;
173 for(
unsigned int i = 0; i<aux.size(); ++i)
174 result.push_back((
int)aux[i]);
189 result.push_back((
int)it[p]);
201 std::vector<double> values = *it;
202 for(
unsigned int i=0; i<values.size(); ++i)
203 result.push_back((
int)values[i]);
212 m_raster->getValues((
unsigned int)coord.
x, (
unsigned int)coord.
y, result);
220 m_raster->getValue((
unsigned int)coord.
x, (
unsigned int)coord.
y, result, p);
230 result.push_back(it[p]);
242 std::vector<double> values = *it;
243 for(
unsigned int i=0; i<values.size(); ++i)
244 result.push_back(values[i]);
252 return std::auto_ptr<te::rst::Raster>(
static_cast<te::rst::Raster*
>(m_raster->clone()));
258 return std::auto_ptr<te::rst::Raster>();
virtual ~RasterCoverage()
Virtual destructor.
This file contains a concrete class to represent a raster coverage.
This class implements the strategy to iterate with spatial restriction, the iteration occurs inside a...
CoverageType
An enum for the types of coverage.
void set(te::rst::Raster *r, te::dt::DateTime *t)
It sets the raster and its associated datetime.
An utility struct for representing 2D coordinates.
const std::vector< std::string > & getPropertyNames() const
It returns the names of the coverage properties.
void getDouble(const te::gm::Point &l, std::vector< double > &result) const
It returns the values as doubles associated to a given location.
static PolygonIterator end(const te::rst::Raster *r, const te::gm::Polygon *p)
Returns an iterator referring to after the end of the iterator.
const double & getY() const
It returns the Point y-coordinate value.
A point with x and y coordinate values.
An abstract class for raster data strucutures.
std::auto_ptr< te::gm::Geometry > m_sextent
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
A concrete class to represent a raster coverage.
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
void getInt(const te::gm::Point &l, std::vector< int > &result) const
It returns the values as integers associated to a given location.
static PolygonIterator begin(const te::rst::Raster *r, const te::gm::Polygon *p)
Returns an iterator referring to the first value of the band.
SimpleData< double, DOUBLE_TYPE > Double
void getValue(const te::gm::Point &l, boost::ptr_vector< te::dt::AbstractData > &result) const
It returns the values associated to a given location.
An abstract class to represent a coverage.
te::dt::DateTime * getTime()
It returns the time.
A template for atomic data types (integers, floats, strings and others).
RasterCoverage()
A constructor.
te::rst::RasterPtr m_raster
unsigned int getNumberOfProperties() const
It returns the number of properties associated to the coverage.
Coverage * clone() const
It returns a clone of this coverage.
te::rst::Raster * getRaster()
It returns the raster.
const double & getX() const
It returns the Point x-coordinate value.
const std::vector< int > & getPropertyTypes() const
It returns the types of the coverage properties.
TEGEOMEXPORT Geometry * GetGeomFromEnvelope(const Envelope *const e, int srid)
It creates a Geometry (a polygon) from the given envelope.
std::vector< int > m_ptypes
CoverageType getType() const
It returns the coverage type.
te::gm::Geometry * getSpatialExtent() const
It returns the spatial extent of a coverage.