Fix boundary box; fix view box detection.

Detect view box out of overpass turbo JSON data.
This commit is contained in:
Sergey Vartanov 2021-09-29 09:57:30 +03:00
parent 258cd5d149
commit c76db0e3f5
2 changed files with 17 additions and 2 deletions

View file

@ -372,6 +372,14 @@ class OSMData:
node = OSMNode.parse_from_structure(element)
node_map[node.id_] = node
self.add_node(node)
if not self.view_box:
self.view_box = BoundaryBox(
node.coordinates[1],
node.coordinates[0],
node.coordinates[1],
node.coordinates[0],
)
self.view_box.update(node.coordinates)
for element in structure["elements"]:
if element["type"] == "way":