From e2e2a55480aeab6738dd1b796cb38681252c1704 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 10 May 2021 11:58:02 +0100 Subject: [PATCH] Comments --- media.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/media.py b/media.py index 3b4455896..ecbb986fa 100644 --- a/media.py +++ b/media.py @@ -161,13 +161,19 @@ def spoofGeolocation(baseDir: str, fraction = randint(0, 100000) / 100000 latitude += \ distanceFromCityCenter * cityRadius * math.cos(angleRadians) + # add a small amount of variance around the location latitude += (fraction * fraction * variance) - (variance / 2.0) + # gps locations aren't transcendental, so round to a fixed + # number of decimal places latitude = int(latitude * 10000) / 10000.0 fraction = randint(0, 100000) / 100000 longitude += \ distanceFromCityCenter * cityRadius * math.sin(angleRadians) + # add a small amount of variance around the location longitude += (fraction * fraction * variance) - (variance / 2.0) + # gps locations aren't transcendental, so round to a fixed + # number of decimal places longitude = int(longitude * 10000) / 10000.0 return latitude, longitude, latdirection, longdirection