movingpandas.Trajectory.to_traj_gdf#

Trajectory.to_traj_gdf(wkt=False, agg=False)#

Return a GeoDataFrame with one row containing the trajectory as a single LineString.

Parameters:
  • wkt (bool) – If True, adds WKT column representing the trajectory geometry

  • agg (dict) – Adds columns with aggregate values computed from trajectory dataframe columns according to specified aggregation mode, using pandas.DataFrame.agg(), and shortcuts for “mode” and quantiles (e.g. “q5” or “q95”)

Examples

>>> traj.to_traj_gdf(agg={"col1": "mode", "col2": ["min", "q95"]})
Return type:

GeoDataFrame