Exclude invalid gps datetimes

This commit is contained in:
Tim Staat 2025-09-05 12:28:33 +02:00
parent bda17d8ec9
commit a4286d6e9b

View File

@ -30,7 +30,7 @@ geodesic = Geod(ellps='WGS84')
current_datetime = datetime.utcnow() current_datetime = datetime.utcnow()
date_yesterday = current_datetime - timedelta(days=1) date_yesterday = current_datetime - timedelta(days=1)
date_tomorrow = current_datetime + timedelta(days=1) date_tomorrow = current_datetime + timedelta(days=1)
valid_date = True
@app.route('/') @app.route('/')
def hello(): def hello():
@ -46,6 +46,8 @@ def getGpsDistance():
lat = dm(lat) if lat and len(lat) > 1 else 0.0 lat = dm(lat) if lat and len(lat) > 1 else 0.0
long = dm(long) if long and len(long) > 1 else 0.0 long = dm(long) if long and len(long) > 1 else 0.0
valid_date = True
print(request.args) print(request.args)
try: try: