Mercurial Hosting > traffic-intelligence
diff python/storage.py @ 751:79405a938407 dev
corrected bug
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Wed, 28 Oct 2015 23:22:57 -0400 |
parents | 6049e9b6902c |
children | 14963a9c3b09 |
line wrap: on
line diff
--- a/python/storage.py Wed Oct 28 17:50:32 2015 -0400 +++ b/python/storage.py Wed Oct 28 23:22:57 2015 -0400 @@ -777,7 +777,6 @@ objects[objNum].curvilinearPositions = moving.CurvilinearTrajectory(S = npround(tmp['POS'].tolist(), nDecimals), Y = npround(tmp['POSLAT'].tolist(), nDecimals), lanes = tmp['LANE'].tolist()) if objectNumbers is not None and objectNumbers > 0 and len(objects) >= objectNumbers: break - return objects.values() else: if filename.endswith(".fzp"): inputfile = openCheck(filename, quitting = True) @@ -798,7 +797,6 @@ objects[objNum].timeInterval.last = instant objects[objNum].curvilinearPositions.addPositionSYL(s, y, lane) line = readline(inputfile, '*$') - return objects.values() elif filename.endswith(".sqlite"): connection = sqlite3.connect(filename) cursor = connection.cursor() @@ -806,7 +804,6 @@ if objectNumbers is not None: queryStatement += ' WHERE trajectory_id '+getObjectCriteria(objectNumbers) queryStatement += ' ORDER BY trajectory_id, t' - #objects = loadTrajectoriesFromTable(connection, "curvilinear_positions", "vissim_curvilinear", objectNumbers) for row in cursor: objNum = row[1] instant = row[0]*simulationStepsPerTimeUnit @@ -823,7 +820,7 @@ objects[objNum].curvilinearPositions.addPositionSYL(s, y, lane) else: print("File type of "+filename+" not supported (only .sqlite and .fzp files)") - + return objects.values() def selectPDLanes(data, lanes = None): '''Selects the subset of data for the right lanes