zealscott / st2vec Goto Github PK
View Code? Open in Web Editor NEWSource code for Spatio-Temporal Trajectory Similarity Learning in Road Networks. KDD 2022.
Home Page: https://arxiv.org/abs/2112.09339
License: Apache License 2.0
Source code for Spatio-Temporal Trajectory Similarity Learning in Road Networks. KDD 2022.
Home Page: https://arxiv.org/abs/2112.09339
License: Apache License 2.0
Hi there. Sorry to bother again. First of all, I would like to express my gratitude for sharing your amazing work and responding the previous questions! I am trying to understand the codes for map matching part so I added the following codes to STmatching_distribution_ver.py
. Hope it is correct by logic.
if __name__ == '__main__':
import pickle
import pandas
fr = open("data/tdrive/st_traj/tdrive.pkl",'rb')
trs = pickle.load(fr)
traj_df = pd.DataFrame([])
for col, values in trs.iterrows():
traj_i = pd.DataFrame(data=values['trajectory'], columns=['LON', 'LAT'])
traj_i['TRAJ_ID'] = values['id']
trajectory = values['trajectory']
traj_df = pd.concat([traj_df, traj_i], axis=0)
print("end")
traj_task_list = data_convert(traj_df)
mmtr_list = []
for traj in traj_task_list:
mmtr = trajectory_matching(traj)
mmtr_list.append(mmtr)
print(mmtr_list)
However, most matched vertex sequences in mmtr_list
contain some nan
vertices. Should I ignore nan
values or just eliminate those trajectories?
Also, Could you explain a little bit more about how to get the ultimate matching_result.csv
file? Maybe I'm missing something.
Thanks so much!
Zixin Qin
BJTU
After I use openStreetMap to get road network data(a shp file), what should I do to preprocess it so that I can get the experiment data?
Traceback (most recent call last):
File "E:\codes\github\ST2Vec\preprocess.py", line 203, in
prepare_dataset(trajfile=str(config["traj_file"]), timefile=str(config["time_file"]), kseg=config["kseg"])
File "E:\codes\github\ST2Vec\preprocess.py", line 34, in prepare_dataset
node_list_int = np.array(node_list_int)
^^^^^^^^^^^^^^^^^^^^^^^
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (29830,) + inhomogeneous part.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.