mirror of
https://github.com/enzet/map-machine.git
synced 2025-07-04 02:07:44 +02:00
Refactor node boundary box.
This commit is contained in:
parent
c64eefec0b
commit
8bfc4f3676
1 changed files with 9 additions and 6 deletions
|
@ -171,6 +171,14 @@ class OSMNode(Tagged):
|
||||||
coordinates=np.array((structure["lat"], structure["lon"])),
|
coordinates=np.array((structure["lat"], structure["lon"])),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def get_boundary_box(self) -> BoundaryBox:
|
||||||
|
return BoundaryBox(
|
||||||
|
self.coordinates[1],
|
||||||
|
self.coordinates[0],
|
||||||
|
self.coordinates[1],
|
||||||
|
self.coordinates[0],
|
||||||
|
)
|
||||||
|
|
||||||
def __hash__(self) -> int:
|
def __hash__(self) -> int:
|
||||||
return self.id_
|
return self.id_
|
||||||
|
|
||||||
|
@ -346,12 +354,7 @@ class OSMData:
|
||||||
self.time.update(node.timestamp)
|
self.time.update(node.timestamp)
|
||||||
|
|
||||||
if not self.boundary_box:
|
if not self.boundary_box:
|
||||||
self.boundary_box = BoundaryBox(
|
self.boundary_box = node.get_boundary_box()
|
||||||
node.coordinates[1],
|
|
||||||
node.coordinates[0],
|
|
||||||
node.coordinates[1],
|
|
||||||
node.coordinates[0],
|
|
||||||
)
|
|
||||||
self.boundary_box.update(node.coordinates)
|
self.boundary_box.update(node.coordinates)
|
||||||
|
|
||||||
def add_way(self, way: OSMWay) -> None:
|
def add_way(self, way: OSMWay) -> None:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue