movingpandas.Trajectory.clip#

Trajectory.clip(polygon, point_based=False)#

Return trajectory segments clipped by the given polygon.

By default, the trajectory’s line representation is clipped by the polygon. If pointbased=True, the trajectory’s point representation is used instead, leading to shorter segments.

Parameters:
  • polygon (shapely Polygon) – Polygon to clip with

  • point_based (bool) – Clipping method

Returns:

Clipped trajectory segments

Return type:

TrajectoryCollection