test geometry update

This commit is contained in:
Guille Gutierrez 2020-06-30 16:51:49 -04:00
parent 924f15169e
commit f3156df417
2 changed files with 23 additions and 1 deletions

View File

@ -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)

View File

@ -33,7 +33,7 @@ class TestPhysicsFactory(TestCase):
def _get_city_with_physics(self): def _get_city_with_physics(self):
if self._nyc_with_physics is None: if self._nyc_with_physics is None:
self._nyc_with_physics = self._get_citygml() 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 return self._nyc_with_physics
def test_city_with_physics(self): def test_city_with_physics(self):