All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
te::st::RasterCoverage Class Reference

A concrete class to represent a raster coverage. More...

#include <RasterCoverage.h>

Inheritance diagram for te::st::RasterCoverage:
te::st::Coverage

Public Member Functions

te::rst::RastergetRaster ()
 It returns the raster. More...
 
te::dt::DateTimegetTime ()
 It returns the time. More...
 
 RasterCoverage ()
 A constructor. More...
 
 RasterCoverage (te::rst::Raster *r, te::dt::DateTime *t)
 A constructor. More...
 
void set (te::rst::Raster *r, te::dt::DateTime *t)
 It sets the raster and its associated datetime. More...
 
virtual ~RasterCoverage ()
 Virtual destructor. More...
 
Coverage inherited methods
Coverageclone () const
 It returns a clone of this coverage. More...
 
CoverageType getType () const
 It returns the coverage type. More...
 
te::gm::GeometrygetSpatialExtent () const
 It returns the spatial extent of a coverage. More...
 
te::dt::DateTimegetTime () const
 It returns the time associated to the coverage. More...
 
unsigned int getNumberOfProperties () const
 It returns the number of properties associated to the coverage. More...
 
const std::vector< int > & getPropertyTypes () const
 It returns the types of the coverage properties. More...
 
const std::vector< std::string > & getPropertyNames () const
 It returns the names of the coverage properties. More...
 
void getValue (const te::gm::Point &l, boost::ptr_vector< te::dt::AbstractData > &result) const
 It returns the values associated to a given location. More...
 
std::auto_ptr
< te::dt::AbstractData
getValue (const te::gm::Point &l, unsigned int p=0) const
 It returns the value of the p-th property associated to a given location. More...
 
void getValue (const te::gm::Polygon &l, unsigned int p, boost::ptr_vector< te::dt::AbstractData > &result) const
 It returns the values of the p-th property associated to the locations inside a given polygon. More...
 
void getValue (const te::gm::Polygon &l, boost::ptr_vector< te::dt::AbstractData > &result) const
 It returns values associated to the locations inside a given polygon. More...
 
void getInt (const te::gm::Point &l, std::vector< int > &result) const
 It returns the values as integers associated to a given location. More...
 
int getInt (const te::gm::Point &l, unsigned int p=0) const
 It returns the value as integer of the p-th property associated to a given location. More...
 
void getInt (const te::gm::Polygon &l, unsigned int p, std::vector< int > &result) const
 It returns the values as integers of the p-th property associated to the locations inside a given polygon. More...
 
void getInt (const te::gm::Polygon &l, std::vector< int > &result) const
 It returns values as integers associated to the locations inside a given polygon. More...
 
void getDouble (const te::gm::Point &l, std::vector< double > &result) const
 It returns the values as doubles associated to a given location. More...
 
double getDouble (const te::gm::Point &l, unsigned int p=0) const
 It returns the value as double of the p-th property associated to a given location. More...
 
void getDouble (const te::gm::Polygon &l, unsigned int p, std::vector< double > &result) const
 It returns the values as doubles of the p-th property associated to the locations inside a given polygon. More...
 
void getDouble (const te::gm::Polygon &l, std::vector< double > &result) const
 It returns values as doubles associated to the locations inside a given polygon. More...
 
std::auto_ptr< te::rst::RastergetRaster () const
 It returns a raster associated to the coverage. More...
 
std::auto_ptr< te::rst::RastergetRaster (unsigned int p) const
 It returns a raster associated to the coverage of the i-th property. More...
 

Protected Attributes

std::vector< std::string > m_pnames
 The types of the raster coverage properties. More...
 
std::vector< int > m_ptypes
 
te::rst::RasterPtr m_raster
 
std::auto_ptr< te::gm::Geometrym_sextent
 
te::dt::DateTimeShrPtr m_time
 

Detailed Description

A concrete class to represent a raster coverage.

A raster coverage is a coverage composed of an observation that is represented by a raster.

See also
Coverage Raster Property

Definition at line 57 of file RasterCoverage.h.

Constructor & Destructor Documentation

te::st::RasterCoverage::RasterCoverage ( )

A constructor.

It constructs an empty raster coverage.

Definition at line 43 of file RasterCoverage.cpp.

te::st::RasterCoverage::RasterCoverage ( te::rst::Raster r,
te::dt::DateTime t 
)

A constructor.

It constructs a raster coverage.

Parameters
rA raster
tThe spatial extent
Note
It will take the ownership of the given pointers.
The grid associated to the given raster must be valid (method Raster::getGrid()).

Definition at line 52 of file RasterCoverage.cpp.

References te::gm::GetGeomFromEnvelope(), m_ptypes, m_raster, and m_sextent.

te::st::RasterCoverage::~RasterCoverage ( )
virtual

Virtual destructor.

Definition at line 261 of file RasterCoverage.cpp.

Member Function Documentation

te::st::Coverage * te::st::RasterCoverage::clone ( ) const
virtual

It returns a clone of this coverage.

Returns
A new coverage.
Note
The caller will take the ownership of the returned pointer.

Implements te::st::Coverage.

Definition at line 89 of file RasterCoverage.cpp.

void te::st::RasterCoverage::getDouble ( const te::gm::Point l,
std::vector< double > &  result 
) const
virtual

It returns the values as doubles associated to a given location.

This method returns the values of all properties of the coverage.

Parameters
lThe given location
resultThe returned values associated to a given location

Implements te::st::Coverage.

Definition at line 209 of file RasterCoverage.cpp.

References te::gm::Point::getX(), te::gm::Point::getY(), te::gm::Coord2D::x, and te::gm::Coord2D::y.

double te::st::RasterCoverage::getDouble ( const te::gm::Point l,
unsigned int  p = 0 
) const
virtual

It returns the value as double of the p-th property associated to a given location.

Parameters
lThe given location
pThe index of the property that will be considered.
Returns
Returns the value as a double associated to a given location

Implements te::st::Coverage.

Definition at line 216 of file RasterCoverage.cpp.

References te::gm::Point::getX(), te::gm::Point::getY(), te::gm::Coord2D::x, and te::gm::Coord2D::y.

void te::st::RasterCoverage::getDouble ( const te::gm::Polygon l,
unsigned int  p,
std::vector< double > &  result 
) const
virtual

It returns the values as doubles of the p-th property associated to the locations inside a given polygon.

Parameters
lThe given polygon
pThe desired property
resultThe returned values of the p-th property associated to the locations inside a given polygon

Implements te::st::Coverage.

Definition at line 224 of file RasterCoverage.cpp.

References te::rst::PolygonIterator< T >::begin(), and te::rst::PolygonIterator< T >::end().

void te::st::RasterCoverage::getDouble ( const te::gm::Polygon l,
std::vector< double > &  result 
) const
virtual

It returns values as doubles associated to the locations inside a given polygon.

This method returns the values of all properties of the coverage, ordered by locations.

An example, if the coverage has two properties: The first position of the result vector contains the first property value of first location. The second position of the result vector contains the second property value of the first location. The third position of the result vector contains the first property value of the second location. And so on.

Parameters
lThe given polygon
resultThe returned values associated the locations inside a given polygon

Implements te::st::Coverage.

Definition at line 236 of file RasterCoverage.cpp.

References te::rst::PolygonIterator< T >::begin(), and te::rst::PolygonIterator< T >::end().

void te::st::RasterCoverage::getInt ( const te::gm::Point l,
std::vector< int > &  result 
) const
virtual

It returns the values as integers associated to a given location.

This method returns the values of all properties of the coverage.

Parameters
lThe given location
resultThe returned values associated to a given location

Implements te::st::Coverage.

Definition at line 169 of file RasterCoverage.cpp.

References getDouble().

int te::st::RasterCoverage::getInt ( const te::gm::Point l,
unsigned int  p = 0 
) const
virtual

It returns the value as integer of the p-th property associated to a given location.

Parameters
lThe given location
pThe index of the property that will be considered.
Returns
Returns the value as an integer associated to a given location

Implements te::st::Coverage.

Definition at line 178 of file RasterCoverage.cpp.

References getDouble().

void te::st::RasterCoverage::getInt ( const te::gm::Polygon l,
unsigned int  p,
std::vector< int > &  result 
) const
virtual

It returns the values as integers of the p-th property associated to the locations inside a given polygon.

Parameters
lThe given polygon
pThe desired property
resultThe returned values of the p-th property associated to the locations inside a given polygon

Implements te::st::Coverage.

Definition at line 183 of file RasterCoverage.cpp.

References te::rst::PolygonIterator< T >::begin(), and te::rst::PolygonIterator< T >::end().

void te::st::RasterCoverage::getInt ( const te::gm::Polygon l,
std::vector< int > &  result 
) const
virtual

It returns values as integers associated to the locations inside a given polygon.

This method returns the values of all properties of the coverage, ordered by locations.

An example, if the coverage has two properties: The first position of the result vector contains the first property value of first location. The second position of the result vector contains the second property value of the first location. The third position of the result vector contains the first property value of the second location. And so on.

Parameters
lThe given polygon
resultThe returned values associated the locations inside a given polygon.

Implements te::st::Coverage.

Definition at line 195 of file RasterCoverage.cpp.

References te::rst::PolygonIterator< T >::begin(), and te::rst::PolygonIterator< T >::end().

unsigned int te::st::RasterCoverage::getNumberOfProperties ( ) const
virtual

It returns the number of properties associated to the coverage.

For raster coverage, the number of properties is equal to the number of bands. For point coverage, this means the number of properties associated to each point.

Returns
The number of properties associated to the coverage.
Note
The caller will NOT take the ownership of the returned date and time.

Implements te::st::Coverage.

Definition at line 110 of file RasterCoverage.cpp.

const std::vector< std::string > & te::st::RasterCoverage::getPropertyNames ( ) const
virtual

It returns the names of the coverage properties.

Returns
The names of the coverage properties.
Note
The caller will take a refence to the internal vector.

Implements te::st::Coverage.

Definition at line 120 of file RasterCoverage.cpp.

const std::vector< int > & te::st::RasterCoverage::getPropertyTypes ( ) const
virtual

It returns the types of the coverage properties.

Returns
The types of the coverage properties.
Note
The caller will take a refence to the internal vector.

Implements te::st::Coverage.

Definition at line 115 of file RasterCoverage.cpp.

te::rst::Raster * te::st::RasterCoverage::getRaster ( )

It returns the raster.

Returns
the raster
Note
The caller will NOT take the ownership of the returned raster.

Definition at line 79 of file RasterCoverage.cpp.

std::auto_ptr< te::rst::Raster > te::st::RasterCoverage::getRaster ( ) const
virtual

It returns a raster associated to the coverage.

For point coverage, it considers the interpolation function to generate the raster.

The returned raster will contain all properties, each property will be a band. If the caller wants to consider only one property, it must use the other getRaster method when the caller pass a defined property.

Returns
Returns a raster associated to the coverage.
Note
The caller will take the ownership of the returned raster.

Implements te::st::Coverage.

Definition at line 250 of file RasterCoverage.cpp.

std::auto_ptr< te::rst::Raster > te::st::RasterCoverage::getRaster ( unsigned int  p) const
virtual

It returns a raster associated to the coverage of the i-th property.

For point coverage, it considers the interpolation function to generate a raster.

The returned raster will have one band associated to the given property.

Parameters
pThe property that will be considered to generate the raster.
Returns
Returns a raster associated to the coverage.
Note
The caller will take the ownership of the returned raster.

Implements te::st::Coverage.

Definition at line 255 of file RasterCoverage.cpp.

te::gm::Geometry * te::st::RasterCoverage::getSpatialExtent ( ) const
virtual

It returns the spatial extent of a coverage.

Returns
Returns the coverage spatial extent.
Note
The caller will NOT take the ownership of the returned geometry.

Implements te::st::Coverage.

Definition at line 100 of file RasterCoverage.cpp.

te::dt::DateTime * te::st::RasterCoverage::getTime ( )

It returns the time.

Returns
the time
Note
The caller will NOT take the ownership of the returned time.

Definition at line 84 of file RasterCoverage.cpp.

te::dt::DateTime * te::st::RasterCoverage::getTime ( ) const
virtual

It returns the time associated to the coverage.

Returns
Returns the time associated to the coverage.
Note
The caller will NOT take the ownership of the returned date and time.

Implements te::st::Coverage.

Definition at line 105 of file RasterCoverage.cpp.

te::st::CoverageType te::st::RasterCoverage::getType ( ) const
virtual

It returns the coverage type.

For while, there are two kinds of Coverages: Point Coverage and Raster Coverage.

Returns
Returns the coverage type.

Implements te::st::Coverage.

Definition at line 95 of file RasterCoverage.cpp.

References te::st::RASTER_COVERAGE.

void te::st::RasterCoverage::getValue ( const te::gm::Point l,
boost::ptr_vector< te::dt::AbstractData > &  result 
) const
virtual

It returns the values associated to a given location.

This method returns the values of all properties of the coverage.

Parameters
lThe given location
resultThe returned values associated to a given location
Note
The caller will take the ownership of the returned value.

Implements te::st::Coverage.

Definition at line 125 of file RasterCoverage.cpp.

References getDouble().

std::auto_ptr< te::dt::AbstractData > te::st::RasterCoverage::getValue ( const te::gm::Point l,
unsigned int  p = 0 
) const
virtual

It returns the value of the p-th property associated to a given location.

Parameters
lThe given location
pThe index of the property that will be considered.
Returns
Returns the value associated to a given location
Note
The caller will take the ownership of the returned value.

Implements te::st::Coverage.

Definition at line 134 of file RasterCoverage.cpp.

References getDouble().

void te::st::RasterCoverage::getValue ( const te::gm::Polygon l,
unsigned int  p,
boost::ptr_vector< te::dt::AbstractData > &  result 
) const
virtual

It returns the values of the p-th property associated to the locations inside a given polygon.

Parameters
lThe given polygon
pThe desired property
resultThe returned values of the p-th property associated to the locations inside a given polygon
Note
The caller will take the ownership of the returned value.

Implements te::st::Coverage.

Definition at line 140 of file RasterCoverage.cpp.

References te::rst::PolygonIterator< T >::begin(), and te::rst::PolygonIterator< T >::end().

void te::st::RasterCoverage::getValue ( const te::gm::Polygon l,
boost::ptr_vector< te::dt::AbstractData > &  result 
) const
virtual

It returns values associated to the locations inside a given polygon.

This method returns the values of all properties of the coverage, ordered by locations.

An example, if the coverage has two properties: The first position of the result vector contains the first property value of first location. The second position of the result vector contains the second property value of the first location. The third position of the result vector contains the first property value of the second location. And so on.

Parameters
lThe given polygon
resultThe returned values associated the locations inside a given polygon
Note
The caller will take the ownership of the returned value.

Implements te::st::Coverage.

Definition at line 154 of file RasterCoverage.cpp.

References te::rst::PolygonIterator< T >::begin(), and te::rst::PolygonIterator< T >::end().

void te::st::RasterCoverage::set ( te::rst::Raster r,
te::dt::DateTime t 
)

It sets the raster and its associated datetime.

Parameters
rThe given raster.
tThe time associated to the given raster.
Note
It will take the ownwership of the given pointers.
The grid associated to the given raster must be valid (method Raster::getGrid()).

Definition at line 66 of file RasterCoverage.cpp.

References te::gm::GetGeomFromEnvelope().

Member Data Documentation

std::vector<std::string> te::st::RasterCoverage::m_pnames
protected

The types of the raster coverage properties.

Definition at line 165 of file RasterCoverage.h.

std::vector<int> te::st::RasterCoverage::m_ptypes
protected

Definition at line 164 of file RasterCoverage.h.

Referenced by RasterCoverage().

te::rst::RasterPtr te::st::RasterCoverage::m_raster
protected

Definition at line 161 of file RasterCoverage.h.

Referenced by RasterCoverage().

std::auto_ptr<te::gm::Geometry> te::st::RasterCoverage::m_sextent
protected

Definition at line 163 of file RasterCoverage.h.

Referenced by RasterCoverage().

te::dt::DateTimeShrPtr te::st::RasterCoverage::m_time
protected

Definition at line 162 of file RasterCoverage.h.


The documentation for this class was generated from the following files: