From b7441741c042ef17c8f9f64cd56d9d9508be5d82 Mon Sep 17 00:00:00 2001 From: Paul Bienkowski Date: Sun, 10 Oct 2021 11:12:07 +0200 Subject: [PATCH] api: Fix track again, using correct filters to get all points --- api/scripts | 2 +- api/src/process_track.py | 22 +++++++++++++--------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/api/scripts b/api/scripts index 16909ea..6beab2e 160000 --- a/api/scripts +++ b/api/scripts @@ -1 +1 @@ -Subproject commit 16909ea356ff6695d3e97d46efce78bca5fe5c40 +Subproject commit 6beab2ebfede7e41a1184b5ae1d0be0c83f8f95c diff --git a/api/src/process_track.py b/api/src/process_track.py index d7d3a1f..8a24358 100644 --- a/api/src/process_track.py +++ b/api/src/process_track.py @@ -7,13 +7,14 @@ import json from obs.face.importer import ImportMeasurementsCsv from obs.face.annotate import AnnotateMeasurements from obs.face.filter import ( - PrivacyFilter, - ChainFilter, AnonymizationMode, - RequiredFieldsFilter, + ChainFilter, ConfirmedFilter, + DistanceMeasuredFilter, + PrivacyFilter, PrivacyZone, PrivacyZonesFilter, + RequiredFieldsFilter, ) from obs.face.osm import DataSource as OSMDataSource @@ -105,10 +106,14 @@ def process(args): ), *filters_from_settings, ) - confirmed_filter = ConfirmedFilter() + events_filter = DistanceMeasuredFilter() + confirmed_filter = ChainFilter( + ConfirmedFilter(), + ) - valid_measurements = input_filter.filter(measurements, log=log) - confirmed_measurements = confirmed_filter.filter(valid_measurements, log=log) + track_measurements = input_filter.filter(measurements, log=log) + event_measurements = events_filter.filter(track_measurements , log=log) + confirmed_measurements = confirmed_filter.filter(track_measurements, log=log) # write out confirmed_measurements_json = { @@ -144,8 +149,7 @@ def process(args): "confirmed": m in confirmed_measurements, }, } - for m in valid_measurements - if m["distance_overtaker"] or m["distance_stationary"] + for m in event_measurements ], } @@ -154,7 +158,7 @@ def process(args): "geometry": { "type": "LineString", "coordinates": [ - [m["latitude"], m["longitude"]] for m in valid_measurements + [m["latitude"], m["longitude"]] for m in track_measurements ], }, }