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"
40 #include "../interpolator/NearestGeometryAtTimeInterp.h"
43 int idPropIdx,
const std::string&
id)
45 m_type(tPropIdx, gPropIdx, idPropIdx, id),
52 int idPropIdx,
const std::string&
id,
55 m_type(tPropIdx, gPropIdx, idPropIdx, id),
62 int gPropIdx,
int idPropIdx,
const std::string&
id)
63 : m_obsDs(new
ObservationDataSet(ds, tPropIdxs, std::vector<int>(1,gPropIdx), gPropIdx)),
64 m_type(tPropIdxs, gPropIdx, idPropIdx, id),
73 : m_obsDs(new
ObservationDataSet(ds, tPropIdxs, std::vector<int>(1,gPropIdx), gPropIdx, text, sext)),
74 m_type(tPropIdxs, gPropIdx, idPropIdx, id),
119 return m_obsDs->getData()->size();
124 return m_obsDs->moveNext();
129 return m_obsDs->movePrevious();
134 return m_obsDs->moveFirst();
139 return m_obsDs->moveBeforeFirst();
144 return m_obsDs->moveLast();
149 return m_obsDs->isAtBegin();
154 return m_obsDs->isBeforeBegin();
159 return m_obsDs->isAtEnd();
164 return m_obsDs->isAfterEnd();
169 int geomPropIdx = m_type.getGeomPropIdx();
170 return std::auto_ptr<te::gm::Geometry>(m_obsDs->getData()->getGeometry(geomPropIdx));
176 int phTimePropIdx = m_type.getBeginTimePropIdx();
177 return std::auto_ptr<te::dt::DateTime>(m_obsDs->getData()->getDateTime(phTimePropIdx));
182 return m_obsDs->getTemporalExtent();
187 return m_obsDs->getSpatialExtent();
196 std::auto_ptr<te::dt::DateTime> time(ds->
getDateTime(m_type.getBeginTimePropIdx()));
197 std::auto_ptr<te::gm::Geometry> geom(ds->
getGeometry(m_type.getGeomPropIdx()));
198 result->
add(time.release(), geom.release());
200 return std::auto_ptr<te::st::Trajectory>(result);
A class to represent trajectory.
virtual std::auto_ptr< te::dt::DateTime > getDateTime(std::size_t i) const =0
Method for retrieving a date and time attribute value.
A class that contains complemental information about a DataSet that holds observations of a trajector...
This file contains a class to represent a trajectory data set.
virtual bool moveNext()=0
It moves the internal pointer to the next item of the collection.
void setId(const std::string &id)
It sets the identifier associated to the trajectory.
This file contains a class to represent a trajectory.
ObservationDataSet * getObservationSet() const
It returns the data set that contains the trajectory observations.
A class to represent a DataSet that contains observations.
bool isBeforeBegin() const
An abstract class to represent a period of date and time.
TrajectoryDataSet(te::da::DataSet *ds, int tPropIdx, int gPropIdx, int idPropIdx, const std::string &id)
Constructor.
const te::gm::Envelope & getSpatialExtent() const
It returns the spatial extent of the trajectory observations.
std::size_t size() const
It returns the size of the trajectory observation set.
te::dt::DateTimePeriod * getTemporalExtent() const
It returns the temporal extent of the trajectory observations.
virtual ~TrajectoryDataSet()
It returns the trajectory geometry property.
std::string getId() const
It returns the identifier associated to the trajectory.
std::auto_ptr< te::gm::Geometry > getGeometry() const
void add(te::dt::DateTime *time, te::gm::Geometry *geom)
It adds an observation (time and geometry) into the trajectory.
static NearestGeometryAtTimeInterp & getInstance()
It returns a reference to the singleton instance.
virtual std::auto_ptr< te::gm::Geometry > getGeometry(std::size_t i) const =0
Method for retrieving a geometric attribute value.
An Envelope defines a 2D rectangular region.
An abstract class for an interpolation function or interpolator that estimates geometries at non-obse...
std::auto_ptr< Trajectory > getTrajectory()
It returns the trajectory from the DataSet.
A dataset is the unit of information manipulated by the data access module of TerraLib.
std::auto_ptr< te::dt::DateTime > getTime() const
It returns the time pointed by the internal cursor.
const TrajectoryDataSetType & getType() const
It returns a reference to the internal trajectory data set type.