summaryrefslogtreecommitdiff
path: root/scripts/process_route.py
diff options
context:
space:
mode:
authorLeonard Kugis <leonard@kug.is>2024-01-05 14:34:46 +0100
committerLeonard Kugis <leonard@kug.is>2024-01-05 14:34:46 +0100
commit06f2e290a07a5856ecb9103e0e69cca418d9c93c (patch)
treeb4b15d7d2886e0ae2674d4487ac6914a8ddf4b2c /scripts/process_route.py
parentcd171b38ba3b7be5735ae29e9a09ea2ba35e8323 (diff)
process_route: Added explaination comment.main
Diffstat (limited to 'scripts/process_route.py')
-rw-r--r--scripts/process_route.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/process_route.py b/scripts/process_route.py
index 643d7dd..e2034fe 100644
--- a/scripts/process_route.py
+++ b/scripts/process_route.py
@@ -44,6 +44,13 @@ def calculate_timestamp(data, current_index):
prev_timestamp = calculate_timestamp(data, current_index - 1)
return prev_timestamp + data[current_index-1]['distance'] / data[current_index]['speed']
+# Function process_route
+# Parameters:
+# input_filename: Input file name
+# output_filename: Output file name
+# Returns: None
+# This function calculates the bearings and timestamps for a route file in JSON-format
+# with given latitude, longitude and speed parameters.
def process_route(input_filename, output_filename):
with open(input_filename, 'r') as infile:
data = json.load(infile)