Mercurial > hg > nsaunier > traffic-intelligence
comparison python/storage.py @ 1015:cf9d29de3dbf
merge With Pr Saunier's code
| author | Wendlasida |
|---|---|
| date | Mon, 04 Jun 2018 11:25:49 -0400 |
| parents | 75601be6019f |
| children | 16932cefabc1 |
comparison
equal
deleted
inserted
replaced
| 1014:026f6b3b122c | 1015:cf9d29de3dbf |
|---|---|
| 964 "CREATE TABLE IF NOT EXISTS curvilinear_positions (t REAL, trajectory_id INTEGER, link_id INTEGER, lane_id INTEGER, s_coordinate REAL, y_coordinate REAL, speed REAL, PRIMARY KEY (t, trajectory_id));\n"+ | 964 "CREATE TABLE IF NOT EXISTS curvilinear_positions (t REAL, trajectory_id INTEGER, link_id INTEGER, lane_id INTEGER, s_coordinate REAL, y_coordinate REAL, speed REAL, PRIMARY KEY (t, trajectory_id));\n"+ |
| 965 ".import "+filename+" curvilinear_positions\n"+ | 965 ".import "+filename+" curvilinear_positions\n"+ |
| 966 "DELETE FROM curvilinear_positions WHERE trajectory_id IS NULL OR trajectory_id = \"NO\";\n") | 966 "DELETE FROM curvilinear_positions WHERE trajectory_id IS NULL OR trajectory_id = \"NO\";\n") |
| 967 out.close() | 967 out.close() |
| 968 # system call | 968 # system call |
| 969 from subprocess import check_call | 969 from subprocess import run |
| 970 out = openCheck("err.log", "w") | 970 out = openCheck("err.log", "w") |
| 971 check_call("sqlite3 "+utils.removeExtension(filename)+".sqlite < "+sqlScriptFilename, stderr = out, shell = True) | 971 run("sqlite3 "+utils.removeExtension(filename)+".sqlite < "+sqlScriptFilename, stderr = out) |
| 972 out.close() | 972 out.close() |
| 973 shutil.os.remove(sqlScriptFilename) | 973 shutil.os.remove(sqlScriptFilename) |
| 974 | 974 |
| 975 def loadObjectNumbersInLinkFromVissimFile(filename, linkIds): | 975 def loadObjectNumbersInLinkFromVissimFile(filename, linkIds): |
| 976 '''Finds the ids of the objects that go through any of the link in the list linkIds''' | 976 '''Finds the ids of the objects that go through any of the link in the list linkIds''' |
