merge-requests/30/head
Bob Mottram 2021-05-10 11:59:31 +01:00
parent 6337cf9aca
commit 55fc1c8d91
1 changed files with 2 additions and 3 deletions

View File

@ -163,17 +163,16 @@ def spoofGeolocation(baseDir: str,
# add a small amount of variance around the location
fraction = randint(0, 100000) / 100000
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
longitude += \
distanceFromCityCenter * cityRadius * math.sin(angleRadians)
# add a small amount of variance around the location
fraction = randint(0, 100000) / 100000
longitude += (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
longitude = int(longitude * 10000) / 10000.0
return latitude, longitude, latdirection, longdirection