diff --git a/geometry/geometry_feeders/osm_subway.py b/geometry/geometry_feeders/osm_subway.py new file mode 100644 index 00000000..05cf6622 --- /dev/null +++ b/geometry/geometry_feeders/osm_subway.py @@ -0,0 +1,22 @@ +""" +OsmSubway module parses osm files and import the metro location into the city model structure +SPDX - License - Identifier: LGPL - 3.0 - or -later +Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca +""" + +import xmltodict + + +class OsmSubway: + def __init__(self, path): + with open(path) as osm: + self._osm = xmltodict.parse(osm.read(), force_list='tag') + for node in self._osm['osm']['node']: + if 'tag' not in node: + continue + for tag in node['tag']: + if '@v' not in tag: + continue + if tag['@v'] == 'subway_entrance': + print(tag['@v']) + print(node) diff --git a/tests/test_physics_factory.py b/tests/test_physics_factory.py index 4ae7d925..05bd87c0 100644 --- a/tests/test_physics_factory.py +++ b/tests/test_physics_factory.py @@ -33,7 +33,7 @@ class TestPhysicsFactory(TestCase): def _get_city_with_physics(self): if self._nyc_with_physics is None: self._nyc_with_physics = self._get_citygml() - PhysicsFactory('us_new_york_city', self._nyc_with_physics, base_path=self._example_path) + PhysicsFactory('us_new_york', self._nyc_with_physics, base_path=self._example_path) return self._nyc_with_physics def test_city_with_physics(self):