TrajectoryDistance.cpp
Go to the documentation of this file.
1 // Examples
2 #include "STExamples.h"
3 
4 // TerraLib
5 #include <terralib/dataaccess.h>
6 #include <terralib/datatype.h>
7 #include <terralib/geometry.h>
8 #include <terralib/st.h>
9 
10 // STL
11 #include <iostream>
12 
14 {
15  if(tj1 == 0)
16  {
17  std::cout << "The first trajectory is NULL!" << std::endl;
18  return;
19  }
20 
21  if(tj2 == 0)
22  {
23  std::cout << "The second trajectory is NULL!" << std::endl;
24  return;
25  }
26 
27  //Second: calculate the distance
28  std::unique_ptr<te::st::TimeSeries> distance = tj1->getDistance(*tj2);
29 
30  std::cout << "Printing the distance between two trajectories " << std::endl;
31  std::cout << "============================================================" << std::endl;
32 
33  PrintTimeSeries(distance.get());
34 }
35 
This file contains include headers for the Data Type module of TerraLib.
void PrintTimeSeries(boost::ptr_vector< te::st::TimeSeries > &input)
It prints all observations of the time series (PrintTimeSeries.cpp)
Examples on how to load/manipulate st types.
void TrajectoryDistance(te::st::Trajectory *tj1, te::st::Trajectory *tj2)
It calculates the distance between two trajectories (TrajectoryDistance.cpp).
This file contains include headers for the TerraLib ST module.
A class to represent trajectory.
Definition: Trajectory.h:75
This file contains include headers for the Vector Geometry model of TerraLib.
This file contains include headers for the Data Access module of TerraLib.
std::unique_ptr< TimeSeries > getDistance(const Trajectory &other) const
It returns the distance between two trajectories.
Definition: Trajectory.cpp:515