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