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> 55 for(std::size_t i=0; i<
m_raster->getNumberOfBands(); ++i)
68 for(std::size_t i=0; i<
m_raster->getNumberOfBands(); ++i)
85 static_cast<te::dt::DateTime*>(
m_time->clone()));
105 return static_cast<unsigned int>(
m_raster->getNumberOfBands());
120 std::vector<double> aux;
122 for(
unsigned int i = 0; i<aux.size(); ++i)
130 return std::unique_ptr<te::dt::AbstractData>(
new te::dt::Double(result));
134 boost::ptr_vector<te::dt::AbstractData>& result)
const 140 double value = it[
p];
148 boost::ptr_vector<te::dt::AbstractData>& result)
const 154 std::vector<double> values = *it;
155 for(
unsigned int i=0; i<values.size(); ++i)
164 std::vector<double> aux;
166 for(
unsigned int i = 0; i<aux.size(); ++i)
167 result.push_back((
int)aux[i]);
182 result.push_back((
int)it[p]);
194 std::vector<double> values = *it;
195 for(
unsigned int i=0; i<values.size(); ++i)
196 result.push_back((
int)values[i]);
205 m_raster->getValues((
unsigned int)coord.
x, (
unsigned int)coord.
y, result);
213 m_raster->getValue((
unsigned int)coord.
x, (
unsigned int)coord.
y, result, p);
223 result.push_back(it[p]);
235 std::vector<double> values = *it;
236 for(
unsigned int i=0; i<values.size(); ++i)
237 result.push_back(values[i]);
251 return std::unique_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.
std::vector< std::string > m_pnames
The types of the raster coverage properties.
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.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
A concrete class to represent a raster coverage.
static PolygonIterator begin(const te::rst::Raster *r, const te::gm::Polygon *p, const IterationType iterationType)
Returns an iterator referring to the first value of the band.
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.
te::dt::DateTimeShrPtr m_time
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.
std::unique_ptr< te::gm::Geometry > m_sextent
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.