Mercurial > hg > nsaunier > traffic-intelligence
comparison c/feature-based-tracking.cpp @ 167:ed2de414e5f6
sql to create views
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Fri, 30 Sep 2011 02:04:56 -0400 |
| parents | 4eb13ed73d84 |
| children | 6ec7f6c61daf |
comparison
equal
deleted
inserted
replaced
| 166:4eb13ed73d84 | 167:ed2de414e5f6 |
|---|---|
| 260 for (int i=0; i<5; ++i) { | 260 for (int i=0; i<5; ++i) { |
| 261 stringstream ss; | 261 stringstream ss; |
| 262 ss << *trajectories[i]; | 262 ss << *trajectories[i]; |
| 263 cout << ss.str() << endl; | 263 cout << ss.str() << endl; |
| 264 } | 264 } |
| 265 | |
| 266 // create views for first and last instants for each trajectory | |
| 267 // CREATE VIEW IF NOT EXISTS trajectory_first_instants AS select trajectory_id, min(frame_number) as first_instant from positions group by trajectory_id | |
| 268 // CREATE VIEW IF NOT EXISTS trajectory_last_instants AS select trajectory_id, max(frame_number) as last_instant from positions group by trajectory_id | |
| 269 //select trajectory_id from trajectory_first_instants where first_instant = 49 | |
| 270 | |
| 271 | |
| 272 | |
| 273 | |
| 265 trajectoryDB->endTransaction(); | 274 trajectoryDB->endTransaction(); |
| 266 trajectoryDB->disconnect(); | 275 trajectoryDB->disconnect(); |
| 267 } | 276 } |
| 268 | 277 |
| 269 return 0; | 278 return 0; |
