Mercurial > hg > nsaunier > traffic-intelligence
comparison python/storage.py @ 552:ca6bded754ac
corrected more bugs from merging (caught in regression tests)
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Tue, 08 Jul 2014 17:04:55 -0400 |
| parents | b5525249eda1 |
| children | 36605d843be5 |
comparison
equal
deleted
inserted
replaced
| 551:dc3739ac2371 | 552:ca6bded754ac |
|---|---|
| 63 | 63 |
| 64 connection.commit() | 64 connection.commit() |
| 65 connection.close() | 65 connection.close() |
| 66 | 66 |
| 67 def writeFeaturesToSqlite(objects, outFilename, trajectoryType, objectNumbers = -1): | 67 def writeFeaturesToSqlite(objects, outFilename, trajectoryType, objectNumbers = -1): |
| 68 '''write features trajectories maintain trajectory ID,velocities dataset ''' | 68 '''write features trajectories maintain trajectory ID,velocities dataset ''' |
| 69 connection = sqlite3.connect(outFilename) | 69 connection = sqlite3.connect(outFilename) |
| 70 cursor = connection.cursor() | 70 cursor = connection.cursor() |
| 71 | 71 |
| 72 cursor.execute("CREATE TABLE IF NOT EXISTS \"positions\"(trajectory_id INTEGER,frame_number INTEGER, x_coordinate REAL, y_coordinate REAL, PRIMARY KEY(trajectory_id, frame_number))") | 72 cursor.execute("CREATE TABLE IF NOT EXISTS \"positions\"(trajectory_id INTEGER,frame_number INTEGER, x_coordinate REAL, y_coordinate REAL, PRIMARY KEY(trajectory_id, frame_number))") |
| 73 cursor.execute("CREATE TABLE IF NOT EXISTS \"velocities\"(trajectory_id INTEGER,frame_number INTEGER, x_coordinate REAL, y_coordinate REAL, PRIMARY KEY(trajectory_id, frame_number))") | 73 cursor.execute("CREATE TABLE IF NOT EXISTS \"velocities\"(trajectory_id INTEGER,frame_number INTEGER, x_coordinate REAL, y_coordinate REAL, PRIMARY KEY(trajectory_id, frame_number))") |
