Mercurial Hosting > traffic-intelligence
comparison python/storage.py @ 647:458890c0437c
cleaned functions to lead bounding boxes (for display)
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Wed, 15 Apr 2015 16:35:02 +0200 |
parents | 6680a69d5bf3 |
children | df9ddeaee4a6 |
comparison
equal
deleted
inserted
replaced
646:6680a69d5bf3 | 647:458890c0437c |
---|---|
552 printDBError(error) | 552 printDBError(error) |
553 connection.commit() | 553 connection.commit() |
554 connection.close() | 554 connection.close() |
555 | 555 |
556 def loadBoundingBoxTableForDisplay(filename): | 556 def loadBoundingBoxTableForDisplay(filename): |
557 '''Loads bounding boxes from bounding_boxes table for display over trajectories''' | |
557 connection = sqlite3.connect(filename) | 558 connection = sqlite3.connect(filename) |
558 cursor = connection.cursor() | 559 cursor = connection.cursor() |
559 boundingBoxes = {} # list of bounding boxes for each instant | 560 boundingBoxes = {} # list of bounding boxes for each instant |
560 try: | 561 try: |
561 cursor.execute('SELECT name FROM sqlite_master WHERE type=\'table\' AND name=\'bounding_boxes\'') | 562 cursor.execute('SELECT name FROM sqlite_master WHERE type=\'table\' AND name=\'bounding_boxes\'') |
567 except sqlite3.OperationalError as error: | 568 except sqlite3.OperationalError as error: |
568 printDBError(error) | 569 printDBError(error) |
569 return boundingBoxes | 570 return boundingBoxes |
570 connection.close() | 571 connection.close() |
571 return boundingBoxes | 572 return boundingBoxes |
572 | |
573 def loadBoundingBoxTable(filename): | |
574 connection = sqlite3.connect(filename) | |
575 cursor = connection.cursor() | |
576 boundingBoxes = [] | |
577 | |
578 try: | |
579 pass | |
580 except sqlite3.OperationalError as error: | |
581 printDBError(error) | |
582 return boundingBoxes | |
583 connection.close() | |
584 return boundingBoxes | |
585 | |
586 | 573 |
587 ######################### | 574 ######################### |
588 # txt files | 575 # txt files |
589 ######################### | 576 ######################### |
590 | 577 |