Skip to content

Commit

Permalink
forget localisation data dict in generate_location.py
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-f committed Sep 23, 2024
1 parent 059e528 commit 782d12f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions services/telit/generate_location.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ def main():
args = parser.parse_args()
time_part = datetime.datetime.now().strftime(args.time_format)
document = {"date": time_part,"TPV": {"lat": args.latitude,"lon": args.longitude,"alt": args.altitude},"hwa": args.hwa}
# create special entry specifically for elastic search
document["location"] = {"lat": document["TPV"]["lat"],
"lon": document["TPV"]["lon"],
"z": document["TPV"]["alt"]}
document_path = os.path.join(args.output, "location_"+time_part+".json.gz")
exists = os.path.exists(document_path)
with open_file_for_write(document_path) as fp:
Expand Down
2 changes: 1 addition & 1 deletion services/telit/zero_location.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def main():
break
document[result["class"]] = result
# Read stuff from telit
if "TPV" in document.keys() and "lat" in document["TPV"].keys():
if "TPV" in document.keys() and {"lat", "lon", "alt"}.issubset(document["TPV"].keys()):
# create special entry specifically for elastic search
document["location"] = {"lat": document["TPV"]["lat"],
"lon": document["TPV"]["lon"],
Expand Down

0 comments on commit 782d12f

Please sign in to comment.