Trajectory Classes

Trajectory Collection

Trajectory (Trip)

class mtldp.mtltrajs.Trajectory(traj_id, trip_id, trip_attributes=None, df=None)
__init__(traj_id, trip_id, trip_attributes=None, df=None)

Initiate trajectory from the trajectory collection

Parameters
  • trip_id (str) – trajectory id

  • df – data frame of all points in the trajectory

  • traj_id (str) –

Return type

None

__setattr__(name, value, /)

Implement setattr(self, name, value).

get_point_attributes(*args)

Get the point attributes as a list

example: >> lats, lons, times = trajectory.get_point_attributes(“latitude”, “longitude”, “timestamp”)

Parameters

args – point attributes of interest

Returns

overall list of point attributes

Return type

list

set_point_attributes(**kwargs)

Set the point attributes

example: >> trajectory.set_point_attributes(relative_dis=list())

Parameters

kwargs – new attribute name and attribute values

Point