From fbf2c15869f1c16cb9b230f216879fb26701b3bf Mon Sep 17 00:00:00 2001 From: Manos Date: Wed, 6 Oct 2021 10:26:28 +0200 Subject: [PATCH] lmdk_lib: Omitting landmark id --- code/lib/lmdk_lib.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/code/lib/lmdk_lib.py b/code/lib/lmdk_lib.py index d7ffbbc..0d1bf80 100644 --- a/code/lib/lmdk_lib.py +++ b/code/lib/lmdk_lib.py @@ -852,9 +852,9 @@ def find_lmdks(usrs_data, args): 0: uid, 1: lat, 2: lng, 3: tim Returns: usrs_lmdks - The users' landmarks. - 0: lid, 1: uid, 2: lat, 3: lng, 4: tim + 0: uid, 1: lat, 2: lng, 3: tim ''' - usrs_lmdks = np.empty((0,5), np.float32) + usrs_lmdks = np.empty((0,4), np.float32) traj_cur = 0 lmdk_id = 0 usrs = np.unique(usrs_data[:,0]) @@ -877,9 +877,9 @@ def find_lmdks(usrs_data, args): if is_valid((traj[j][1], traj[j][2])): # Add the beginning only the first time if j == i + 1: - lmdk_cur.append([lmdk_id, usr, traj[i][1], traj[i][2], traj[i][3]]) + lmdk_cur.append([usr, traj[i][1], traj[i][2], traj[i][3]]) # Add the new point - lmdk_cur.append([lmdk_id, usr, traj[j][1], traj[j][2], traj[j][3]]) + lmdk_cur.append([usr, traj[j][1], traj[j][2], traj[j][3]]) # Distance in meters dist = distance((traj[i][1], traj[i][2]), (traj[j][1], traj[j][2])).km*1000 # Distance exceeded or reached end of iteration @@ -1073,6 +1073,6 @@ def is_landmark(p, lmdks): Returns: True/False ''' - if len(lmdks) and any(np.equal(lmdks[:, 1:5], p).all(1)): + if len(lmdks) and any(np.equal(lmdks, p).all(1)): return True return False