Fix bearings on road info, and German words for those

This commit is contained in:
Paul Bienkowski 2023-04-01 20:19:59 +02:00
parent dd72ed791f
commit 251be4a699
2 changed files with 12 additions and 10 deletions

View file

@ -18,14 +18,16 @@ round_speed = partial(round_to, multiples=0.1)
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
def get_bearing(a, b):
def get_bearing(b, a):
# longitude, latitude # longitude, latitude
dL = b[0] - a[0] dL = b[0] - a[0]
X = numpy.cos(b[1]) * numpy.sin(dL) X = numpy.cos(b[1]) * numpy.sin(dL)
Y = numpy.cos(a[1]) * numpy.sin(b[1]) - numpy.sin(a[1]) * numpy.cos( Y = numpy.cos(a[1]) * numpy.sin(b[1]) - numpy.sin(a[1]) * numpy.cos(
b[1] b[1]
) * numpy.cos(dL) ) * numpy.cos(dL)
return numpy.arctan2(X, Y) return numpy.arctan2(Y, X) + 0.5 * math.pi
# Bins for histogram on overtaker distances. 0, 0.25, ... 2.25, infinity # Bins for histogram on overtaker distances. 0, 0.25, ... 2.25, infinity
DISTANCE_BINS = numpy.arange(0, 2.5, 0.25).tolist() + [float('inf')] DISTANCE_BINS = numpy.arange(0, 2.5, 0.25).tolist() + [float('inf')]

View file

@ -204,14 +204,14 @@ MapPage:
cardinalDirections: cardinalDirections:
unknown: unbekannt unknown: unbekannt
north: nordwärts north: Norden
northEast: nordostwärts northEast: Nordosten
east: ostwärts east: Osten
southEast: südostwärts southEast: Südosten
south: südwärts south: Süden
southWest: südwestwärts southWest: Südwesten
west: westwärts west: Westen
northWest: nordwestwärts northWest: Nordwesten
regionInfo: regionInfo:
unnamedRegion: Unbenannte Region unnamedRegion: Unbenannte Region