|
| | TrajectoryCollection (std::unordered_map< std::string, std::variant< std::vector< Id >, std::vector< std::time_t >, std::vector< double > > > &&dataframe, std::array< double, 4 > const &bbox={}) |
| | Construct a TrajectoryCollection from a dataframe.
|
| |
| | TrajectoryCollection (std::string const &fileName=std::string(), std::unordered_map< std::string, std::string > const &column_mapping={}, char const sep=';', std::array< double, 4 > const &bbox={}) |
| | Construct a TrajectoryCollection, optionally importing from a CSV file.
|
| |
| void | import (std::string const &fileName, std::unordered_map< std::string, std::string > const &column_mapping={}, char const sep=';', std::array< double, 4 > const &bbox={}) |
| | Import trajectories from a CSV file.
|
| |
| void | to_csv (std::string const &fileName, char const sep=';') const |
| | Export clustered trajectories to a CSV file with columns 'uid', 'trajectory_id', 'lon', 'lat', 'timestamp_in', 'timestamp_out'.
|
| |
| void | filter (double const cluster_radius_km, double const max_speed_kph=150.0, std::size_t const min_points_per_trajectory=2, std::optional< std::time_t > const min_duration_min=std::nullopt) |
| | Filter all point trajectories to identify stop points based on clustering and speed criteria.
|
| |
| auto const & | trajectories () const noexcept |
| | Get the underlying trajectories map.
|
| |
◆ TrajectoryCollection() [1/2]
| dsf::mdt::TrajectoryCollection::TrajectoryCollection |
( |
std::unordered_map< std::string, std::variant< std::vector< Id >, std::vector< std::time_t >, std::vector< double > > > && | dataframe, |
|
|
std::array< double, 4 > const & | bbox = {} ) |
Construct a TrajectoryCollection from a dataframe.
- Parameters
-
| dataframe | An unordered_map representing the dataframe with columns: 'uid', 'timestamp', 'lat', 'lon'. |
| bbox | Optional bounding box [minX, minY, maxX, maxY] to limit the area of interest. Default is empty (no bounding box). |
◆ TrajectoryCollection() [2/2]
| dsf::mdt::TrajectoryCollection::TrajectoryCollection |
( |
std::string const & | fileName = std::string(), |
|
|
std::unordered_map< std::string, std::string > const & | column_mapping = {}, |
|
|
char const | sep = ';', |
|
|
std::array< double, 4 > const & | bbox = {} ) |
Construct a TrajectoryCollection, optionally importing from a CSV file.
- Parameters
-
| fileName | The path to the CSV file. |
| column_mapping | A mapping of column names. |
| sep | The character used to separate values in the CSV file. |
| bbox | Optional bounding box [minX, minY, maxX, maxY] to limit the area of interest. Default is empty (no bounding box). |
◆ filter()
| void dsf::mdt::TrajectoryCollection::filter |
( |
double const | cluster_radius_km, |
|
|
double const | max_speed_kph = 150.0, |
|
|
std::size_t const | min_points_per_trajectory = 2, |
|
|
std::optional< std::time_t > const | min_duration_min = std::nullopt ) |
Filter all point trajectories to identify stop points based on clustering and speed criteria.
- Parameters
-
| cluster_radius_km | The radius (in kilometers) to use for clustering points. |
| max_speed_kph | The max allowed speed (in km/h) to consider a cluster as a stop point. Default is 150.0 km/h. |
| min_points_per_trajectory | The minimum number of points required for a trajectory to be considered valid. Default is 2. |
| min_duration_min | The minimum duration (in minutes) for a cluster to be considered a stop point. If stops are detected, trajectories may be split into multiple segments. |
◆ import()
| void dsf::mdt::TrajectoryCollection::import |
( |
std::string const & | fileName, |
|
|
std::unordered_map< std::string, std::string > const & | column_mapping = {}, |
|
|
char const | sep = ';', |
|
|
std::array< double, 4 > const & | bbox = {} ) |
Import trajectories from a CSV file.
- Parameters
-
| fileName | The path to the CSV file. Accepts columns: 'uid', 'timestamp', 'lat', 'lon'. |
| column_mapping | A mapping of column names. |
| sep | The character used to separate values in the CSV file. |
| bbox | Optional bounding box [minX, minY, maxX, maxY] to limit the area of interest. Default is empty (no bounding box). |
◆ to_csv()
| void dsf::mdt::TrajectoryCollection::to_csv |
( |
std::string const & | fileName, |
|
|
char const | sep = ';' ) const |
Export clustered trajectories to a CSV file with columns 'uid', 'trajectory_id', 'lon', 'lat', 'timestamp_in', 'timestamp_out'.
- Parameters
-
| fileName | The path to the output CSV file. |
| sep | The character used to separate values in the CSV file. |
◆ trajectories()
| auto const & dsf::mdt::TrajectoryCollection::trajectories |
( |
| ) |
const |
|
inlinenoexcept |
Get the underlying trajectories map.
- Returns
- A const reference to the map of trajectories.
The documentation for this class was generated from the following files:
- src/dsf/mdt/TrajectoryCollection.hpp
- src/dsf/mdt/TrajectoryCollection.cpp