27 #include "../../../dataaccess/dataset/DataSet.h"
28 #include "../../../datatype/DateTime.h"
29 #include "../../../datatype/DateTimePeriod.h"
30 #include "../../../datatype/DateTimeInstant.h"
31 #include "../../../datatype/SimpleData.h"
32 #include "../../../geometry/Geometry.h"
33 #include "../../../geometry/Utils.h"
38 #include "../observation/ObservationDataSet.h"
39 #include "../observation/ObservationDataSetType.h"
44 const std::vector<std::string>& propNames)
46 m_vlPropNames(propNames),
52 const std::vector<std::string>& propNames,
const std::string&
id)
54 m_vlPropNames(propNames),
60 const std::string&
id)
62 m_vlPropNames(propNames),
94 return m_obsDs->getData()->size();
99 return m_obsDs->moveNext();
104 return m_obsDs->movePrevious();
109 return m_obsDs->moveFirst();
114 return m_obsDs->moveBeforeFirst();
119 return m_obsDs->moveLast();
124 return m_obsDs->isAtBegin();
129 return m_obsDs->isBeforeBegin();
134 return m_obsDs->isAtEnd();
139 return m_obsDs->isAfterEnd();
145 std::string phTimePropName = m_obsDs->getType().getBeginTimePropName();
146 return std::auto_ptr<te::dt::DateTime>(m_obsDs->getData()->getDateTime(phTimePropName));
151 return std::auto_ptr<te::dt::AbstractData>(m_obsDs->getData()->getValue(idx));
156 return std::auto_ptr<te::dt::AbstractData>(m_obsDs->getData()->getValue(m_vlPropNames[0]));
161 return m_obsDs->getData()->getDouble(idx);
166 return m_obsDs->getData()->getDouble(m_vlPropNames[0]);
171 return m_obsDs->getData()->getInt32(idx);
176 return m_obsDs->getData()->getInt32(m_vlPropNames[0]);
181 if(m_obsDs->getType().hasGeomProp())
182 return std::auto_ptr<te::gm::Geometry>(m_obsDs->getData()->getGeometry(m_obsDs->getType().getGeomPropName()));
183 else if (m_obsDs->getType().hasGeometry())
184 return std::auto_ptr<te::gm::Geometry>(dynamic_cast<te::gm::Geometry*>(m_obsDs->getType().getGeometry()->clone()));
185 return std::auto_ptr<te::gm::Geometry>();
190 return m_obsDs->getType().getTemporalExtent();
195 return std::auto_ptr<te::st::TimeSeries>(getTimeSeries(m_vlPropNames[0],interp));
198 std::auto_ptr<te::st::TimeSeries>
201 std::auto_ptr<te::st::TimeSeries> result(
new TimeSeries(interp,m_id));
207 std::auto_ptr<te::gm::Geometry> geom = getGeometry();
209 result->setLocation(geom.release());
212 std::auto_ptr<te::dt::DateTime> time(ds->
getDateTime(m_obsDs->getType().getBeginTimePropName()));
213 std::auto_ptr<te::dt::AbstractData> value(ds->
getValue(propN));
214 result->add(time.release(), value.release());
217 std::auto_ptr<te::dt::AbstractData> tsid(ds->
getValue(propN));
218 result->setId(tsid->toString());
224 std::auto_ptr<te::dt::DateTime> time(ds->
getDateTime(m_obsDs->getType().getBeginTimePropName()));
225 std::auto_ptr<te::dt::AbstractData> value(ds->
getValue(propN));
226 result->add(time.release(), value.release());
232 const std::string& vPropName,
233 std::vector<te::st::TimeSeries*>& result)
236 std::set<std::string> seriesIds;
242 std::auto_ptr<te::dt::AbstractData> tsid(ds->
getValue(vPropName));
244 if(seriesIds.insert(tsid->toString()).second)
247 result.push_back(ts);
250 std::auto_ptr<te::gm::Geometry> geom = getGeometry();
252 result[count]->setLocation(geom.release());
258 std::auto_ptr<te::dt::DateTime> time(ds->
getDateTime(m_obsDs->getType().getBeginTimePropName()));
259 std::auto_ptr<te::dt::AbstractData> value(ds->
getValue(m_vlPropNames[0]));
260 result[count-1]->add(time.release(), value.release());
268 std::auto_ptr<te::da::DataSet> result(m_obsDs->release());
virtual std::auto_ptr< te::dt::DateTime > getDateTime(std::size_t i) const =0
Method for retrieving a date and time attribute value.
std::auto_ptr< TimeSeries > getTimeSeries(te::st::AbstractTimeSeriesInterp *interp)
It returns the time series from the DataSet.
std::size_t size() const
It returns the size of the time series observation set.
A class to represent a DataSet that contains observations.
ObservationDataSet * getObservationSet() const
It returns the data set that contains the time series observations.
bool isBeforeBegin() const
int getInt() const
It returns the observed value as double pointed by the internal cursor.
double getDouble() const
It returns the observed value as double pointed by the internal cursor.
This file contains a class to represent a time series data set.
const te::dt::DateTimePeriod * getTemporalExtent() const
It returns the temporal extent of the time series observations.
std::auto_ptr< te::da::DataSet > release()
It releases all internal pointers, returning its internal DataSet and invalidating itself...
This file contains a class to represent a time series.
void setValuePropNames(const std::vector< std::string > &n)
It sets the names of the DataSet properties that contains the values associated to the time series...
void setId(const std::string &id)
It sets the identifier associated to the time series.
virtual bool moveNext()=0
It moves the internal pointer to the next item of the collection.
TimeSeriesDataSet(te::da::DataSet *ds, const ObservationDataSetType &type, const std::vector< std::string > &propNames)
Constructor.
std::auto_ptr< te::gm::Geometry > getGeometry() const
It returns the geometry pointed by the internal cursor.
std::auto_ptr< te::dt::DateTime > getTime() const
It returns the time pointed by the internal cursor.
void getTimeSeriesSet(te::st::AbstractTimeSeriesInterp *interp, const std::string &vPropName, std::vector< te::st::TimeSeries * > &result)
It returns all time series from the DataSet.
A dataset is the unit of information manipulated by the data access module of TerraLib.
virtual ~TimeSeriesDataSet()
It returns the trajectory geometry property.
An abstract class for an interpolation function or interpolator that estimate a value at non-observav...
An abstract class to represent a period of date and time.
A class to represent time series.
const std::vector< std::string > & getValuePropNames() const
It returns the indexes of the DataSet properties that contains the values associated to the time seri...
A class that contains complemental DataSetType information about a DataSet that holds observations...
std::auto_ptr< te::dt::AbstractData > getValue() const
It returns the observed value pointed by the internal cursor.
std::string getId() const
It returns the identifier associated to the time series.
virtual std::auto_ptr< te::dt::AbstractData > getValue(std::size_t i) const
Method for retrieving any other type of data value stored in the data source.