A class to represent trajectory. More...
#include <Trajectory.h>
Public Member Functions | |
void | add (te::dt::DateTime *time, te::gm::Geometry *geom) |
It adds an observation (time and geometry) into the trajectory. More... | |
void | add (const TrajectoryObservation &p) |
It adds an observation (time and geometry) into the trajectory. More... | |
Trajectory * | clone () const |
It returns a clone of this trajectory. More... | |
std::auto_ptr< TimeSeries > | getDistance (const Trajectory &other) const |
It returns the distance between two trajectories. More... | |
std::auto_ptr< TimeSeries > | getDistance (const te::gm::Geometry &geom) |
It returns the distance between the trajectory and a given geometry. More... | |
std::auto_ptr< te::gm::Geometry > | getGeometry (te::dt::DateTime *t) const |
It returns the geometry associated to a given date and time. More... | |
std::string | getId () const |
It returns the trajectory id. More... | |
AbstractTrajectoryInterp * | getInterpolator () const |
It returns the interpolator associated to the trajectory. More... | |
const TrajectoryObservationSet & | getObservations () const |
It returns the trajectory observations. More... | |
te::gm::Envelope | getSpatialExtent () const |
It returns the spatial extent of the trajectory observations. More... | |
std::auto_ptr< te::dt::DateTimePeriod > | getTemporalExtent () const |
It returns the temporal extent of the trajectory observations. More... | |
Trajectory & | operator= (const Trajectory &other) |
Copy assignment operator. More... | |
void | setId (const std::string &id) |
It sets the trajectory id. More... | |
void | setInterpolator (AbstractTrajectoryInterp *interp) |
It sets the interpolator associated to the path. More... | |
std::size_t | size () const |
It returns the size of the trajectory observations. More... | |
virtual | ~Trajectory () |
Virtual destructor. More... | |
Trajectory Constructors | |
Trajectory () | |
Empty constructor. More... | |
Trajectory (const std::string &id) | |
Empty constructor. More... | |
Trajectory (AbstractTrajectoryInterp *interp, const std::string &id) | |
Empty constructor. More... | |
Trajectory (const TrajectoryObservationSet &obs, const std::string &id) | |
Constructor. More... | |
Trajectory (const TrajectoryObservationSet &obs, AbstractTrajectoryInterp *interp, const std::string &id) | |
Constructor. More... | |
Trajectory (const TrajectoryPatch &patch, AbstractTrajectoryInterp *interp, const std::string &id) | |
It constructs a trajectory from a patch. More... | |
Trajectory (const Trajectory &tj) | |
Copy constructor. More... | |
Trajectory Iterator | |
An example of use: TrajectoryIterator it = tj.begin(); while(it!=tj.end()) { Geometry* g = it.getGeometry(); DateTime* t = it.getTime(); ++it; } | |
TrajectoryIterator | begin () const |
It returns an iterator that points to the first observation of the trajectory. More... | |
TrajectoryIterator | end () const |
It returns an iterator that points to the end of the trajectory. More... | |
TrajectoryIterator | at (te::dt::DateTime *t) const |
It returns an iterator that points to an observation at a given time. More... | |
Trajectory Patch | |
These methods return patches of a trajectory, as TrajectoryPatch objects, that satisfy given restrictions. A TrajectoryPatch object contains only pointers to the initial and final observations that delimit a patch of a Trajectory. The end() method of a TrajectoryPatch object returns an iterator that points to the position AFTER the last required observation. Example of use: TrajectoryPatch patch = tj->getTrajectory(period, "DURING"); TrajectoryIterator it = patch.begin(); while(it!=patch.end()) { Geometry* g = it.getGeometry(); DateTime* t = it.getTime(); ++it; } Other option is to create a new Trajectory from the returned patch: TrajectoryPatch patch = tj->getTrajectory(period, "DURING"); Trajectory tjnew(patch); | |
TrajectoryPatch | getPatch (const te::dt::DateTime &dt, te::dt::TemporalRelation r=te::dt::DURING) const |
It returns a trajectory subset that satisfies a given temporal relation. More... | |
void | getPatches (const te::gm::Envelope &g, te::gm::SpatialRelation r, std::vector< TrajectoryPatch > &result) const |
It returns trajectory subsets that satisfy a given spatial relation. More... | |
void | getPatches (const te::gm::Geometry &geom, te::gm::SpatialRelation r, std::vector< TrajectoryPatch > &result) const |
It returns trajectory subsets that satisfy a given spatial relation. More... | |
void | getPatches (const te::gm::Envelope &e, te::gm::SpatialRelation sr, const te::dt::DateTime &dt, te::dt::TemporalRelation tr, std::vector< TrajectoryPatch > &result) const |
It returns trajectory subsets that satisfy a given spatial and temporal relation. More... | |
void | getPatches (const te::gm::Geometry &geom, te::gm::SpatialRelation sr, const te::dt::DateTime &dt, te::dt::TemporalRelation tr, std::vector< TrajectoryPatch > &result) const |
It returns trajectory subsets that satisfy a given spatial and temporal relation. More... | |
void | getPatches (const te::gm::Geometry &geom, te::st::SpatioTemporalRelation str, const std::vector< TrajectoryPatch > &result) const |
It returns trajectory subsets that satisfy a given spatiotemporal relation. More... | |
Private Attributes | |
std::string | m_id |
The trajectory identification. More... | |
AbstractTrajectoryInterp * | m_interpolator |
The interpolator used to estimate non-observed times. More... | |
TrajectoryObservationSet | m_observations |
The trajectory observations. More... | |
TjRTreeShrPtr | m_rtree |
The RTree to index the trajectory geometries. More... | |
A class to represent trajectory.
A trajectory represents the variation of spatial locations or boundaries of an object over time. It is composed of an observation set and of an interpolator. The observations have a fixed object identity and measured geometries at controlled times. The interpolator is able to estimate spaces at non-observed times.
Definition at line 75 of file Trajectory.h.
te::st::Trajectory::Trajectory | ( | ) |
Empty constructor.
It constructs an empty trajectory. The user does not indicate the interpolator associated to it. Internally, it uses a default interpolator that is NearestGeometryAtTimeInterp.
te::st::Trajectory::Trajectory | ( | const std::string & | id | ) |
Empty constructor.
It constructs an empty trajectory. The user does not indicate the interpolator associated to it. Internally, it uses a default interpolator that is NearestGeometryAtTimeInterp.
id | The trajectory id |
te::st::Trajectory::Trajectory | ( | AbstractTrajectoryInterp * | interp, |
const std::string & | id | ||
) |
Empty constructor.
It constructs an empty trajectory.
interp | The interpolator associated to the trajectory. |
id | The trajectory id. |
te::st::Trajectory::Trajectory | ( | const TrajectoryObservationSet & | obs, |
const std::string & | id | ||
) |
Constructor.
The user does not indicate the interpolator associated to it. Internally, it uses a default interpolator that is NearestGeometryAtTimeInterp.
obs | The trajectory observations. |
id | The trajectory id. |
te::st::Trajectory::Trajectory | ( | const TrajectoryObservationSet & | obs, |
AbstractTrajectoryInterp * | interp, | ||
const std::string & | id | ||
) |
Constructor.
obs | The trajectory observations. |
interp | The interpolator associated to the trajectory. |
id | The trajectory id. |
te::st::Trajectory::Trajectory | ( | const TrajectoryPatch & | patch, |
AbstractTrajectoryInterp * | interp, | ||
const std::string & | id | ||
) |
It constructs a trajectory from a patch.
patch | The given patch. |
interp | The interpolator |
id | The trajectory id |
te::st::Trajectory::Trajectory | ( | const Trajectory & | tj | ) |
Copy constructor.
|
virtual |
Virtual destructor.
void te::st::Trajectory::add | ( | te::dt::DateTime * | time, |
te::gm::Geometry * | geom | ||
) |
It adds an observation (time and geometry) into the trajectory.
time | A pointer to the time. |
data | A pointer to the geometry. |
void te::st::Trajectory::add | ( | const TrajectoryObservation & | p | ) |
It adds an observation (time and geometry) into the trajectory.
p | A pair of date and time. |
TrajectoryIterator te::st::Trajectory::at | ( | te::dt::DateTime * | t | ) | const |
It returns an iterator that points to an observation at a given time.
If there is no observation at this given time, the returned iterator points to the end of the trajectory.
TrajectoryIterator te::st::Trajectory::begin | ( | ) | const |
It returns an iterator that points to the first observation of the trajectory.
Trajectory* te::st::Trajectory::clone | ( | ) | const |
It returns a clone of this trajectory.
TrajectoryIterator te::st::Trajectory::end | ( | ) | const |
It returns an iterator that points to the end of the trajectory.
std::auto_ptr<TimeSeries> te::st::Trajectory::getDistance | ( | const Trajectory & | other | ) | const |
It returns the distance between two trajectories.
other | The other trajectory. |
std::auto_ptr<TimeSeries> te::st::Trajectory::getDistance | ( | const te::gm::Geometry & | geom | ) |
It returns the distance between the trajectory and a given geometry.
geom | A given geometry. |
std::auto_ptr<te::gm::Geometry> te::st::Trajectory::getGeometry | ( | te::dt::DateTime * | t | ) | const |
It returns the geometry associated to a given date and time.
If there is no geometry associated to the given date and time, it will use internally its interpolation function.
t | A date and time. |
std::string te::st::Trajectory::getId | ( | ) | const |
It returns the trajectory id.
AbstractTrajectoryInterp* te::st::Trajectory::getInterpolator | ( | ) | const |
It returns the interpolator associated to the trajectory.
const TrajectoryObservationSet& te::st::Trajectory::getObservations | ( | ) | const |
It returns the trajectory observations.
TrajectoryPatch te::st::Trajectory::getPatch | ( | const te::dt::DateTime & | dt, |
te::dt::TemporalRelation | r = te::dt::DURING |
||
) | const |
It returns a trajectory subset that satisfies a given temporal relation.
The possible temporal relations are: AFTER (2); AFTER | EQUALS (10); 3. BEFORE (1); 4. BEFORE | EQUALS (9); DURING (4); EQUALS (8)
dt | A given date and time. |
r | A given temporal relation. |
void te::st::Trajectory::getPatches | ( | const te::gm::Envelope & | g, |
te::gm::SpatialRelation | r, | ||
std::vector< TrajectoryPatch > & | result | ||
) | const |
It returns trajectory subsets that satisfy a given spatial relation.
The possible spatial relation is: 1. INTERSECTS
g | A given envelope. |
r | A given spatial relation. |
result | The returned patches. |
void te::st::Trajectory::getPatches | ( | const te::gm::Geometry & | geom, |
te::gm::SpatialRelation | r, | ||
std::vector< TrajectoryPatch > & | result | ||
) | const |
It returns trajectory subsets that satisfy a given spatial relation.
The possible spatial relation is: 1. INTERSECTS
geom | A given geometry. |
r | A given spatial relation. |
result | The returned patches. |
void te::st::Trajectory::getPatches | ( | const te::gm::Envelope & | e, |
te::gm::SpatialRelation | sr, | ||
const te::dt::DateTime & | dt, | ||
te::dt::TemporalRelation | tr, | ||
std::vector< TrajectoryPatch > & | result | ||
) | const |
It returns trajectory subsets that satisfy a given spatial and temporal relation.
The possible temporal relations are: AFTER (2); AFTER | EQUALS (10); 3. BEFORE (1); 4. BEFORE | EQUALS (9); DURING (4); EQUALS (8)
The possible spatial relation is: 1. INTERSECTS
e | A given envelope. |
r | A given spatial relation. |
dt | A given date and time. |
r | A given temporal relation. |
result | The returned patches. |
void te::st::Trajectory::getPatches | ( | const te::gm::Geometry & | geom, |
te::gm::SpatialRelation | sr, | ||
const te::dt::DateTime & | dt, | ||
te::dt::TemporalRelation | tr, | ||
std::vector< TrajectoryPatch > & | result | ||
) | const |
It returns trajectory subsets that satisfy a given spatial and temporal relation.
The possible temporal relations are: AFTER (2); AFTER | EQUALS (10); 3. BEFORE (1); 4. BEFORE | EQUALS (9); DURING (4); EQUALS (8)
The possible spatial relation is: 1. INTERSECTS
geom | A given geometry. |
r | A given spatial relation. |
dt | A given date and time. |
r | A given temporal relation. |
result | The returned patches. |
void te::st::Trajectory::getPatches | ( | const te::gm::Geometry & | geom, |
te::st::SpatioTemporalRelation | str, | ||
const std::vector< TrajectoryPatch > & | result | ||
) | const |
It returns trajectory subsets that satisfy a given spatiotemporal relation.
The possible spatiotemporal relations are:
geom | A given geometry. |
srt | A given spatiotemporal relation. |
result | The returned patches. |
te::gm::Envelope te::st::Trajectory::getSpatialExtent | ( | ) | const |
It returns the spatial extent of the trajectory observations.
std::auto_ptr<te::dt::DateTimePeriod> te::st::Trajectory::getTemporalExtent | ( | ) | const |
It returns the temporal extent of the trajectory observations.
Trajectory& te::st::Trajectory::operator= | ( | const Trajectory & | other | ) |
Copy assignment operator.
void te::st::Trajectory::setId | ( | const std::string & | id | ) |
It sets the trajectory id.
id | The trajectory od. |
void te::st::Trajectory::setInterpolator | ( | AbstractTrajectoryInterp * | interp | ) |
It sets the interpolator associated to the path.
interp | A interpolator which is able to estimate geometries in non-observed times. |
std::size_t te::st::Trajectory::size | ( | ) | const |
It returns the size of the trajectory observations.
|
private |
The trajectory identification.
Definition at line 461 of file Trajectory.h.
|
private |
The interpolator used to estimate non-observed times.
Definition at line 460 of file Trajectory.h.
|
private |
The trajectory observations.
Definition at line 459 of file Trajectory.h.
|
private |
The RTree to index the trajectory geometries.
Definition at line 462 of file Trajectory.h.