test geometry update
This commit is contained in:
parent
924f15169e
commit
f3156df417
22
geometry/geometry_feeders/osm_subway.py
Normal file
22
geometry/geometry_feeders/osm_subway.py
Normal 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)
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue
Block a user