Closed mchl0203 closed 3 years ago
I have created a quick solution for this problem, creating a Trajectory object using wkt and timestamps.
I have pushed the commit https://github.com/cyang-kth/fmm/commit/5d0eccf7cac1b1bbdb7e7d4593da7ef1b743b6aa to add the traj class to python binding. You still need to pull the latest program from this repo and reinstall it.
The output of match_traj
is slightly different from the match_wkt
with the pgeom currently missing. I hope this one will not affect your usage.
https://github.com/cyang-kth/fmm/blob/master/example/notebook/stmatch_example.ipynb
from fmm import Trajectory,wkt2linestring
line = wkt2linestring(wkt)
traj_id = 1
timestamps = []
for i in range(line.get_num_points()):
timestamps.append(i)
traj = Trajectory(traj_id,line,timestamps)
result = model.match_traj(traj,stmatch_config)
print "Matched path: ", list(result.cpath)
print "Matched edge for each point: ", list(result.opath)
print "Matched edge index ",list(result.indices)
print "Matched geometry: ",result.mgeom.export_wkt()
@cyang-kth Thanks for your quick reply, nice job!
@cyang-kth can we get the speed from the output of match_traj
?
Thanks
I know that adding the timestamps column to the file can be used for map matching. Is there any other way? I found that the parameter timestamps of
match_wkt
in thestmatch
source code is not released. Is it should be possible to put timestamps as an input parameter?