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),
122 delete m_tpExtent.release();
123 std::auto_ptr<te::da::DataSet> result(m_ds.release());
134 if(m_spExtent.isValid())
137 std::auto_ptr<te::gm::Envelope> env(m_ds->getExtent(m_obst.getGeomPropIdx()));
138 m_spExtent = *(env.get());
149 return m_tpExtent.get();
154 m_tpExtent.reset(ext);
159 return m_ds->moveNext();
164 return m_ds->movePrevious();
169 return m_ds->moveFirst();
174 return m_ds->moveBeforeFirst();
179 return m_ds->moveLast();
184 return m_ds->isAtBegin();
189 return m_ds->isBeforeBegin();
194 return m_ds->isAtEnd();
199 return m_ds->isAfterEnd();
204 std::auto_ptr<te::dt::DateTime> phTime(m_ds->getDateTime(m_obst.getBeginTimePropIdx()));
205 std::auto_ptr<te::dt::DateTime> vlTime(0);
206 std::auto_ptr<te::dt::DateTime> rsTime(0);
208 if(m_obst.getVlBeginTimePropIdx()>-1)
209 vlTime = m_ds->getDateTime(m_obst.getVlBeginTimePropIdx());
211 if(m_obst.getRsTimePropIdx()>-1)
212 rsTime = m_ds->getDateTime(m_obst.getRsTimePropIdx());
214 boost::ptr_vector<te::dt::AbstractData> obsData;
215 for(std::size_t i = 0; i<m_obst.getObsPropIdxs().size(); ++i)
216 obsData.push_back(m_ds->getValue(m_obst.getObsPropIdxs()[i]));
218 return std::auto_ptr<te::st::Observation>(
new
220 static_cast<te::dt::DateTimePeriod*>(vlTime.release()),obsData));
std::auto_ptr< Observation > getObservation() const
It returns the observation pointed by the internal cursor.
A class to represent an observation.
An Envelope defines a 2D rectangular region.
const te::gm::Envelope & getSpatialExtent()
It returns the spatial extent of the observations, when there is an observed value of geometry type...
void setSpatialExtent(const te::gm::Envelope &ext)
It sets the spatial extent of the observations, when there is an observed value of geometry type...
This file contains a class to represent an observation data set.
std::auto_ptr< te::da::DataSet > release()
It releases all internal pointers, returning its internal DataSet and invalidating itself...
bool isBeforeBegin() const
A dataset is the unit of information manipulated by the data access module of TerraLib.
const ObservationDataSetType & getType() const
It returns a reference to the ObservationDataSetType.
An abstract class to represent a period of date and time.
void setTemporalExtent(te::dt::DateTimePeriod *ext)
It sets the temporal extent of the observations, when there is an observed value of geometry type...
ObservationDataSet(te::da::DataSet *ds, const ObservationDataSetType &obst)
Constructor.
te::da::DataSet * getData() const
It returns the DataSet that contains the observations.
A class that contains complemental DataSetType information about a DataSet that holds observations...
te::dt::DateTimePeriod * getTemporalExtent()
It returns the temporal extent of the observations.
virtual ~ObservationDataSet()
It returns the property of the phenomenon beginning time.
An abstract class to represent an instant of date and time.