mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-08-07 01:13:14 +02:00
Update locationdata.py
fix polygone at 4+
This commit is contained in:
@@ -903,6 +903,10 @@ def distance(lat=0,lon=0,nodeID=0, reset=False):
|
||||
total_distance_miles = total_distance_km * 0.621371
|
||||
msg += f", Total: {total_distance_miles:.2f} miles"
|
||||
|
||||
# update the last point in howfarDB
|
||||
if not dupe:
|
||||
howfarDB[nodeID].append({'lat': lat, 'lon': lon, 'time': datetime.now()})
|
||||
|
||||
# if points 3+ are within 30 meters of the first point add the area of the polygon
|
||||
if len(howfarDB[nodeID]) >= 3:
|
||||
points = []
|
||||
@@ -953,11 +957,6 @@ def distance(lat=0,lon=0,nodeID=0, reset=False):
|
||||
lon_centroid = math.degrees(lon_centroid)
|
||||
msg += f", Centroid: {lat_centroid:.5f}, {lon_centroid:.5f}"
|
||||
|
||||
|
||||
# update the last point in howfarDB
|
||||
if not dupe:
|
||||
howfarDB[nodeID].append({'lat': lat, 'lon': lon, 'time': datetime.now()})
|
||||
|
||||
return msg
|
||||
|
||||
def get_openskynetwork(lat=0, lon=0):
|
||||
|
||||
Reference in New Issue
Block a user