Skip to content
Snippets Groups Projects
Commit 962655a8 authored by Raphael's avatar Raphael
Browse files

lilve bug fixes

parent dc4b8781
Branches 19-add-some-tests
No related tags found
No related merge requests found
......@@ -154,7 +154,7 @@ def apply_time_sequence(dat, time, func):
class AISTrajectory(AISPoints):
def __init__(self, df, interpolation_time=None):
# df = df.drop_duplicates(subset=['ts_sec'])
df = df.drop_duplicates(subset=['ts_sec'])
if interpolation_time and len(df.index) > 4:
......@@ -163,7 +163,7 @@ class AISTrajectory(AISPoints):
new_df = pd.DataFrame()
t_raw = df['ts_sec'].to_numpy()
t_interp1d = np.arange(start=t_raw[0], stop=t_raw[-1] + 1,
step=interpolation_time * 60)
step=interpolation_time)
new_df['ts_sec'] = t_interp1d
......@@ -243,7 +243,7 @@ class AISTrajectory(AISPoints):
return {"type": "LineString", "coordinates": coordinates}
def split_trajectory(self, time_gap=600):
def split_trajectory(self, time_gap=600, interpolation=None):
if 'ts_sec' not in self.df:
raise NoTimeInformation()
......@@ -254,7 +254,7 @@ class AISTrajectory(AISPoints):
index = 0
while index < n_sample:
i = compute_trajectory(self.df['ts_sec'][index:].to_numpy(), time_gap)
trajectory = AISTrajectory(work_df[:i])
trajectory = AISTrajectory(work_df[:i], interpolation)
result.append(trajectory)
work_df = work_df[i:]
index += i
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment