-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(UI): vehicles with different width (#64)
fix bug in osm2cityflow converter
- Loading branch information
1 parent
9a4766a
commit d439fc6
Showing
5 changed files
with
124 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import unittest | ||
import os | ||
import json | ||
from tools.converter.osm2cityflow import extract, draw | ||
|
||
|
||
class TestOsmConverter(unittest.TestCase): | ||
dataPath = os.getcwd() + '/data/tools/Converter/examples/' | ||
osmFile = dataPath + 'statecollege.osm' | ||
CityFlowFile = dataPath + 'statecollege_roadnet.json' | ||
|
||
def test_converter(self): | ||
nodes = extract(osmFile=self.osmFile) | ||
draw(nodes, self.CityFlowFile, True) | ||
with open(self.CityFlowFile, 'r') as f: | ||
roadnet = json.load(f) | ||
intersectionsNum = len(roadnet["intersections"]) | ||
roadsNum = len(roadnet["roads"]) | ||
self.assertTrue(intersectionsNum <= roadsNum) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main(verbosity=2) |
Oops, something went wrong.