def intersection_shapely(self,geom): traj = LineString(np.column_stack((self.x[:, np.newaxis], self.y[:, np.newaxis], self.seconds[:, np.newaxis]))) return traj.intersection(geom)