27 #include "../../../dataaccess/dataset/DataSet.h"
28 #include "../../../dataaccess/dataset/DataSetType.h"
29 #include "../../../datatype/DateTime.h"
30 #include "../../../datatype/DateTimePeriod.h"
31 #include "../../../datatype/DateTimeInstant.h"
65 m_obst(phTimeIdx, obsPropIdx, geomPropIdx),
72 const std::vector<int>& obsPropIdxs,
int geomPropIdx)
74 m_obst(phTimeIdxs, obsPropIdxs, geomPropIdx),
83 m_obst(phTimeIdx, obsPropIdx, geomPropIdx),
91 m_obst(phTimeIdx, obsPropIdx, geomPropIdx),
100 m_obst(phTimeIdxs, obsPropIdxs, geomPropIdx),
109 m_obst(phTimeIdxs, obsPropIdxs, geomPropIdx),
127 if(m_spExtent.isValid())
130 std::auto_ptr<te::gm::Envelope> env(m_ds->getExtent(m_obst.getGeomPropIdx()));
131 m_spExtent = *(env.get());
142 return m_tpExtent.get();
147 m_tpExtent.reset(ext);
152 return m_ds->moveNext();
157 return m_ds->movePrevious();
162 return m_ds->moveFirst();
167 return m_ds->moveBeforeFirst();
172 return m_ds->moveLast();
177 return m_ds->isAtBegin();
182 return m_ds->isBeforeBegin();
187 return m_ds->isAtEnd();
192 return m_ds->isAfterEnd();
197 std::auto_ptr<te::dt::DateTime> phTime(m_ds->getDateTime(m_obst.getBeginTimePropIdx()));
198 std::auto_ptr<te::dt::DateTime> vlTime(0);
199 std::auto_ptr<te::dt::DateTime> rsTime(0);
201 if(m_obst.getVlBeginTimePropIdx()>-1)
202 vlTime = m_ds->getDateTime(m_obst.getVlBeginTimePropIdx());
204 if(m_obst.getRsTimePropIdx()>-1)
205 rsTime = m_ds->getDateTime(m_obst.getRsTimePropIdx());
207 boost::ptr_vector<te::dt::AbstractData> obsData;
208 for(std::size_t i = 0; i<m_obst.getObsPropIdxs().size(); ++i)
209 obsData.push_back(m_ds->getValue(m_obst.getObsPropIdxs()[i]));
211 return std::auto_ptr<te::st::Observation>(
new
213 static_cast<te::dt::DateTimePeriod*>(vlTime.release()),obsData));
A class to represent an observation.
std::auto_ptr< Observation > getObservation() const
It returns the observation pointed by the internal cursor.
void setSpatialExtent(const te::gm::Envelope &ext)
It sets the spatial extent of the observations, when there is an observed value of geometry type...
An abstract class to represent a period of date and time.
te::da::DataSet * getData() const
It returns the DataSet that contains the observations.
This file contains a class to represent an observation data set.
void setTemporalExtent(te::dt::DateTimePeriod *ext)
It sets the temporal extent of the observations, when there is an observed value of geometry type...
te::dt::DateTimePeriod * getTemporalExtent()
It returns the temporal extent of the observations.
An abstract class to represent an instant of date and time.
ObservationDataSet(te::da::DataSet *ds, const ObservationDataSetType &obst)
Constructor.
A class that contains complemental DataSetType information about a DataSet that holds observations...
virtual ~ObservationDataSet()
It returns the property of the phenomenon beginning time.
const te::gm::Envelope & getSpatialExtent()
It returns the spatial extent of the observations, when there is an observed value of geometry type...
const ObservationDataSetType & getType() const
It returns a reference to the ObservationDataSetType.
bool isBeforeBegin() const
An Envelope defines a 2D rectangular region.
A dataset is the unit of information manipulated by the data access module of TerraLib.