sync with O'Reilly Atlas
This commit is contained in:
@@ -14,10 +14,10 @@ from dataclasses import dataclass
|
||||
@dataclass(frozen=True)
|
||||
class Coordinate:
|
||||
lat: float
|
||||
long: float
|
||||
lon: float
|
||||
|
||||
def __str__(self):
|
||||
ns = 'N' if self.lat >= 0 else 'S'
|
||||
we = 'E' if self.long >= 0 else 'W'
|
||||
return f'{abs(self.lat):.1f}°{ns}, {abs(self.long):.1f}°{we}'
|
||||
we = 'E' if self.lon >= 0 else 'W'
|
||||
return f'{abs(self.lat):.1f}°{ns}, {abs(self.lon):.1f}°{we}'
|
||||
# end::COORDINATE[]
|
||||
|
||||
Reference in New Issue
Block a user