Mercurial > hg > nsaunier > traffic-intelligence
comparison python/storage.py @ 173:319a04ba9033
function name change
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Wed, 26 Oct 2011 15:04:38 -0400 |
| parents | 436b87d4b992 |
| children | e2f31813ade6 |
comparison
equal
deleted
inserted
replaced
| 172:e508bb0cbb64 | 173:319a04ba9033 |
|---|---|
| 9 | 9 |
| 10 ngsimUserTypes = {'twowheels':1, | 10 ngsimUserTypes = {'twowheels':1, |
| 11 'car':2, | 11 'car':2, |
| 12 'truck':3} | 12 'truck':3} |
| 13 | 13 |
| 14 def loadSqlite(filename, objectNumbers = -1): | 14 def loadTrajectoriesFromSqlite(filename, objectNumbers = -1): |
| 15 '''Loads nObjects or the indices in objectNumbers from the database | 15 '''Loads nObjects or the indices in objectNumbers from the database |
| 16 TODO: load velocities''' | 16 TODO: load velocities''' |
| 17 import sqlite3 | 17 import sqlite3 |
| 18 | 18 |
| 19 connection = sqlite3.connect(filename) # add test if it open | 19 connection = sqlite3.connect(filename) # add test if it open |
| 46 objects.append(obj) | 46 objects.append(obj) |
| 47 | 47 |
| 48 connection.close() | 48 connection.close() |
| 49 return objects | 49 return objects |
| 50 | 50 |
| 51 def loadNgsimFile(filename, nObjects = -1, sequenceNum = -1): | 51 def loadTrajectoriesFromNgsimFile(filename, nObjects = -1, sequenceNum = -1): |
| 52 '''Reads data from the trajectory data provided by NGSIM project | 52 '''Reads data from the trajectory data provided by NGSIM project |
| 53 and returns the list of Feature objects''' | 53 and returns the list of Feature objects''' |
| 54 objects = [] | 54 objects = [] |
| 55 | 55 |
| 56 input = utils.openCheck(filename) | 56 input = utils.openCheck(filename) |
