lmdk_lib: Omitting landmark id

This commit is contained in:
Manos Katsomallos 2021-10-06 10:26:28 +02:00
parent 75c4e6e2ed
commit fbf2c15869

View File

@ -852,9 +852,9 @@ def find_lmdks(usrs_data, args):
0: uid, 1: lat, 2: lng, 3: tim 0: uid, 1: lat, 2: lng, 3: tim
Returns: Returns:
usrs_lmdks - The users' landmarks. 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 traj_cur = 0
lmdk_id = 0 lmdk_id = 0
usrs = np.unique(usrs_data[:,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])): if is_valid((traj[j][1], traj[j][2])):
# Add the beginning only the first time # Add the beginning only the first time
if j == i + 1: 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 # 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 # Distance in meters
dist = distance((traj[i][1], traj[i][2]), (traj[j][1], traj[j][2])).km*1000 dist = distance((traj[i][1], traj[i][2]), (traj[j][1], traj[j][2])).km*1000
# Distance exceeded or reached end of iteration # Distance exceeded or reached end of iteration
@ -1073,6 +1073,6 @@ def is_landmark(p, lmdks):
Returns: Returns:
True/False 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 True
return False return False