Understanding Activity From Trajectory Patterns