mirror of
https://github.com/enzet/map-machine.git
synced 2025-05-22 21:46:24 +02:00
Add web error processing; add boundary box class.
This commit is contained in:
parent
d321f75e21
commit
175b8bb0ae
4 changed files with 88 additions and 73 deletions
|
@ -257,15 +257,23 @@ class BoundaryBox:
|
|||
"""Get right bottom corner of the boundary box."""
|
||||
return self.bottom, self.right
|
||||
|
||||
def get_format_rounded(self) -> str:
|
||||
"""
|
||||
Get text representation of the boundary box:
|
||||
<longitude 1>,<latitude 1>,<longitude 2>,<latitude 2>. Coordinates are
|
||||
rounded to three digits after comma.
|
||||
"""
|
||||
return (
|
||||
f"{self.left - 0.001:.3f},{self.bottom - 0.001:.3f},"
|
||||
f"{self.right + 0.001:.3f},{self.top + 0.001:.3f}"
|
||||
)
|
||||
|
||||
def get_format(self) -> str:
|
||||
"""
|
||||
Get text representation of the boundary box:
|
||||
<longitude 1>,<latitude 1>,<longitude 2>,<latitude 2>. Coordinates are
|
||||
rounded to three digits after comma.
|
||||
"""
|
||||
a = (
|
||||
f"{self.left - 0.001:.3f},{self.bottom - 0.001:.3f},"
|
||||
f"{self.right + 0.001:.3f},{self.top + 0.001:.3f}"
|
||||
return (
|
||||
f"{self.left:.3f},{self.bottom:.3f},{self.right:.3f},{self.top:.3f}"
|
||||
)
|
||||
print(self.left, a)
|
||||
return a
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue