27 #include "../../../dataaccess/dataset/DataSet.h"
28 #include "../../../dataaccess/dataset/DataSetType.h"
29 #include "../../../dataaccess/utils/Utils.h"
30 #include "../../../datatype/DateTime.h"
31 #include "../../../datatype/DateTimePeriod.h"
32 #include "../../../datatype/DateTimeInstant.h"
33 #include "../../../datatype/DateTimeProperty.h"
34 #include "../../../geometry/Utils.h"
35 #include "../../../geometry/GeometryProperty.h"
71 std::auto_ptr<te::da::DataSet> result(m_ds.release());
82 if(m_obst.hasSpatialExtent())
83 return m_obst.getSpatialExtent();
86 std::auto_ptr<te::gm::Envelope> env(m_ds->getExtent(idx));
88 return m_obst.getSpatialExtent();
93 m_obst.setSpatialExtent(ext);
98 return m_obst.getTemporalExtent();
103 m_obst.setTemporalExtent(ext);
108 return m_ds->moveNext();
113 return m_ds->movePrevious();
118 return m_ds->moveFirst();
123 return m_ds->moveBeforeFirst();
128 return m_ds->moveLast();
133 return m_ds->isAtBegin();
138 return m_ds->isBeforeBegin();
143 return m_ds->isAtEnd();
148 return m_ds->isAfterEnd();
153 std::auto_ptr<te::dt::DateTime> phTime(m_ds->getDateTime(m_obst.getBeginTimePropName()));
154 std::auto_ptr<te::dt::DateTime> vlTime(0);
155 std::auto_ptr<te::dt::DateTime> rsTime(0);
157 if(m_obst.hasVlTimeProp())
158 vlTime = m_ds->getDateTime(m_obst.getVlBeginTimePropInfo()->getName());
160 if(m_obst.hasRsTimeProp())
161 rsTime = m_ds->getDateTime(m_obst.getRsTimePropInfo()->getName());
163 boost::ptr_vector<te::dt::AbstractData> obsData;
164 for(std::size_t i = 0; i<m_obst.getObsPropNames().size(); ++i)
165 obsData.push_back(m_ds->getValue(m_obst.getObsPropNames()[i]));
167 return std::auto_ptr<te::st::Observation>(
new
170 static_cast<te::dt::DateTimePeriod*>(vlTime.release()),
177 return m_obst.getBeginTimePropInfo();
183 return m_obst.getEndTimePropInfo();
189 return m_obst.getVlBeginTimePropInfo();
195 return m_obst.getVlEndTimePropInfo();
201 return m_obst.getRsTimePropInfo();
std::auto_ptr< Observation > getObservation() const
It returns the observation pointed by the internal cursor.
const te::dt::DateTimeProperty * getBeginTimeProperty() const
It returns the property of the phenomenon beginning time.
A class to represent an observation.
TEDATAACCESSEXPORT std::size_t GetPropertyPos(const DataSet *dataset, const std::string &name)
ObservationDataSetType m_obst
A data set that contains observations.
const te::dt::DateTimeProperty * getVlEndTimeProperty() const
It returns the property of the valid end time.
const te::dt::DateTimeProperty * getRsTimeProperty() const
It returns the property of the result time.
const te::dt::DateTimeProperty * getVlBeginTimeProperty() const
It returns the property of the valid beginning time.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
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
void setSpatialExtent(te::gm::Geometry *se)
It sets the spatial extent of all observations.
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.
const te::gm::Geometry * getSpatialExtent()
It returns 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.
void setSpatialExtent(te::gm::Geometry *ext)
It sets the spatial extent of the observations, when there is an observed value of geometry type...
void setTemporalExtent(te::dt::DateTimePeriod *te)
It sets the temporal extent of all observations.
The type for date and time types: date, date period, date duration, time duration, time instant, time period, time instant with time zone or time period with time zone.
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...
const te::dt::DateTimePeriod * getTemporalExtent()
It returns the temporal extent of the observations.
virtual ~ObservationDataSet()
Virtual destructor.
TEGEOMEXPORT Geometry * GetGeomFromEnvelope(const Envelope *const e, int srid)
It creates a Geometry (a polygon) from the given envelope.
const te::dt::DateTimeProperty * getEndTimeProperty() const
It returns the property of the phenomenon end time.
An abstract class to represent an instant of date and time.