te::st::PointCoverage Class Reference

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

#include <PointCoverage.h>

Inheritance diagram for te::st::PointCoverage:
te::st::Coverage

Public Member Functions

void add (const te::gm::Point &l, te::dt::AbstractData *value)
 It adds an observtion to the PointCoverage. More...
 
void add (const te::gm::Point &l, boost::ptr_vector< te::dt::AbstractData > &value)
 It adds an observtion to the PointCoverage. More...
 
void add (PointCoverageObservation &obs)
 It adds an observtion to the PointCoverage. More...
 
 PointCoverage ()
 A constructor. More...
 
 PointCoverage (AbstractPointCoverageInterp *interp, te::gm::Geometry *sextent, te::dt::DateTime *textent, int np, const std::vector< int > &ptypes, const std::vector< std::string > &pnames)
 A constructor. More...
 
 PointCoverage (AbstractPointCoverageInterp *interp, te::gm::Geometry *sextent, te::dt::DateTime *textent, int np, const std::vector< int > &ptypes, const std::vector< std::string > &pnames, int tp)
 A constructor. More...
 
virtual ~PointCoverage ()
 Virtual destructor. More...
 
PointCoverage Iterator

An example of use:

PointCoverageIterator it = cv.begin(); while(it!=cv.end()) { Point& l = it.getLocation(); double v = it.getDouble(i); //or getValue() or getInt()... ++it; }

PointCoverageIterator begin () const
 It returns an iterator that points to the first observation of the point coverage. More...
 
PointCoverageIterator end () const
 It returns an iterator that points to the end of the time series. 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::unique_ptr< te::dt::AbstractDatagetValue (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::unique_ptr< te::rst::RastergetRaster () const
 It returns a raster associated to the coverage. More...
 
std::unique_ptr< te::rst::RastergetRaster (unsigned int p) const
 It returns a raster associated to the coverage of the i-th property. More...
 

Protected Attributes

AbstractPointCoverageInterpm_interpolator
 
unsigned int m_np
 
PointCoverageObservationSet m_observations
 
std::vector< std::string > m_pnames
 The types of the point coverage properties. More...
 
std::vector< intm_ptypes
 The number of properties of the point coverage. More...
 
PointCvRTreeShrPtr m_rTree
 
std::unique_ptr< te::gm::Geometrym_sextent
 
std::unique_ptr< te::dt::DateTimem_textent
 
int m_tp
 The names of the point coverage properties. More...
 

Detailed Description

A concrete class to represent a point coverage.

A point coverage is a coverage composed of a set of observations where each one contains a location (point) and a set properties associated to it.

See also
Coverage Point Property

Definition at line 70 of file PointCoverage.h.

Constructor & Destructor Documentation

te::st::PointCoverage::PointCoverage ( )

A constructor.

It constructs an empty point coverage. The user does not indicate the interpolator associated to it. Internally, it uses a default interpolator that is IDWInterpolator.

Definition at line 42 of file PointCoverage.cpp.

References m_rTree.

Referenced by clone().

te::st::PointCoverage::PointCoverage ( AbstractPointCoverageInterp interp,
te::gm::Geometry sextent,
te::dt::DateTime textent,
int  np,
const std::vector< int > &  ptypes,
const std::vector< std::string > &  pnames 
)

A constructor.

It constructs an empty point coverage.

Parameters
interpThe interpolator associated to the PointCoverage
sextentThe spatial extent
textentThe time associated to the coverage.
npThe number of properties of the point coverage.
ptypesThe types of the properties
pnamesThe names of the properties
Note
It will take the ownership of the given pointers.

Definition at line 55 of file PointCoverage.cpp.

References m_rTree.

te::st::PointCoverage::PointCoverage ( AbstractPointCoverageInterp interp,
te::gm::Geometry sextent,
te::dt::DateTime textent,
int  np,
const std::vector< int > &  ptypes,
const std::vector< std::string > &  pnames,
int  tp 
)

A constructor.

It constructs an empty point coverage.

Parameters
interpThe interpolator associated to the PointCoverage
sextentThe spatial extent
textentThe time associated to the coverage.
npThe number of properties of the point coverage.
ptypesThe types of the properties
pnamesThe names of the properties
tpThe index of the property that contains time associated to each observation
Note
It will take the ownership of the given pointers.

Definition at line 73 of file PointCoverage.cpp.

References m_rTree.

te::st::PointCoverage::~PointCoverage ( )
virtualdefault

Virtual destructor.

Referenced by getRaster().

Member Function Documentation

void te::st::PointCoverage::add ( const te::gm::Point l,
te::dt::AbstractData value 
)

It adds an observtion to the PointCoverage.

Parameters
lThe given location.
valueThe value associated to the given location.
Note
It will take the ownwership of the given pointers.
The caller can use this methos when the number of properties is equal to 1. Otherwise, it must use the other add method.

Definition at line 102 of file PointCoverage.cpp.

Referenced by add(), and clone().

void te::st::PointCoverage::add ( const te::gm::Point l,
boost::ptr_vector< te::dt::AbstractData > &  value 
)

It adds an observtion to the PointCoverage.

Parameters
lThe given location.
valueA vector of values associated to the given location.
Note
It will take the ownwership of the given pointers.

Definition at line 112 of file PointCoverage.cpp.

References add().

void te::st::PointCoverage::add ( PointCoverageObservation obs)

It adds an observtion to the PointCoverage.

Parameters
obsThe observation.
Note
It will share the same observtion.

Definition at line 119 of file PointCoverage.cpp.

References m_observations, m_rTree, and p.

te::st::PointCoverageIterator te::st::PointCoverage::begin ( ) const

It returns an iterator that points to the first observation of the point coverage.

Returns
The point coverage iterator.

Definition at line 92 of file PointCoverage.cpp.

References m_observations.

Referenced by te::st::IDWInterpolator::estimate().

te::st::Coverage * te::st::PointCoverage::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 129 of file PointCoverage.cpp.

References add(), m_interpolator, m_np, m_observations, m_pnames, m_ptypes, m_sextent, m_textent, and PointCoverage().

te::st::PointCoverageIterator te::st::PointCoverage::end ( ) const

It returns an iterator that points to the end of the time series.

Returns
The point coverage iterator.

Definition at line 97 of file PointCoverage.cpp.

References m_observations.

Referenced by te::st::IDWInterpolator::estimate().

void te::st::PointCoverage::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 234 of file PointCoverage.cpp.

References getValue(), and m_np.

double te::st::PointCoverage::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 243 of file PointCoverage.cpp.

References getValue().

void te::st::PointCoverage::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 249 of file PointCoverage.cpp.

void te::st::PointCoverage::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 256 of file PointCoverage.cpp.

void te::st::PointCoverage::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 205 of file PointCoverage.cpp.

References getValue(), and m_np.

int te::st::PointCoverage::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 214 of file PointCoverage.cpp.

References getValue().

void te::st::PointCoverage::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 220 of file PointCoverage.cpp.

void te::st::PointCoverage::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 227 of file PointCoverage.cpp.

unsigned int te::st::PointCoverage::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 162 of file PointCoverage.cpp.

References m_np.

const std::vector< std::string > & te::st::PointCoverage::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 172 of file PointCoverage.cpp.

References m_pnames.

const std::vector< int > & te::st::PointCoverage::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 167 of file PointCoverage.cpp.

References m_ptypes.

std::unique_ptr< te::rst::Raster > te::st::PointCoverage::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 263 of file PointCoverage.cpp.

std::unique_ptr< te::rst::Raster > te::st::PointCoverage::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 269 of file PointCoverage.cpp.

References ~PointCoverage().

te::gm::Geometry * te::st::PointCoverage::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 152 of file PointCoverage.cpp.

References m_sextent.

te::dt::DateTime * te::st::PointCoverage::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 157 of file PointCoverage.cpp.

References m_textent.

te::st::CoverageType te::st::PointCoverage::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 147 of file PointCoverage.cpp.

References te::st::POINT_COVERAGE.

void te::st::PointCoverage::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 177 of file PointCoverage.cpp.

References te::st::AbstractPointCoverageInterp::estimate(), m_interpolator, and m_np.

Referenced by getDouble(), and getInt().

std::unique_ptr< te::dt::AbstractData > te::st::PointCoverage::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 184 of file PointCoverage.cpp.

References te::st::AbstractPointCoverageInterp::estimate(), and m_interpolator.

void te::st::PointCoverage::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 189 of file PointCoverage.cpp.

void te::st::PointCoverage::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 197 of file PointCoverage.cpp.

Member Data Documentation

AbstractPointCoverageInterp* te::st::PointCoverage::m_interpolator
protected

Definition at line 232 of file PointCoverage.h.

Referenced by clone(), and getValue().

unsigned int te::st::PointCoverage::m_np
protected

Definition at line 234 of file PointCoverage.h.

Referenced by clone(), getDouble(), getInt(), getNumberOfProperties(), and getValue().

PointCoverageObservationSet te::st::PointCoverage::m_observations
protected

Definition at line 231 of file PointCoverage.h.

Referenced by add(), begin(), clone(), and end().

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

The types of the point coverage properties.

Definition at line 236 of file PointCoverage.h.

Referenced by clone(), and getPropertyNames().

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

The number of properties of the point coverage.

Definition at line 235 of file PointCoverage.h.

Referenced by clone(), and getPropertyTypes().

PointCvRTreeShrPtr te::st::PointCoverage::m_rTree
protected

Definition at line 233 of file PointCoverage.h.

Referenced by add(), and PointCoverage().

std::unique_ptr<te::gm::Geometry> te::st::PointCoverage::m_sextent
protected

Definition at line 229 of file PointCoverage.h.

Referenced by clone(), and getSpatialExtent().

std::unique_ptr<te::dt::DateTime> te::st::PointCoverage::m_textent
protected

Definition at line 230 of file PointCoverage.h.

Referenced by clone(), and getTime().

int te::st::PointCoverage::m_tp
protected

The names of the point coverage properties.

Definition at line 237 of file PointCoverage.h.


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