api: Fix track again, using correct filters to get all points

This commit is contained in:
Paul Bienkowski 2021-10-10 11:12:07 +02:00
parent 59b67e5120
commit b7441741c0
2 changed files with 14 additions and 10 deletions

@ -1 +1 @@
Subproject commit 16909ea356ff6695d3e97d46efce78bca5fe5c40
Subproject commit 6beab2ebfede7e41a1184b5ae1d0be0c83f8f95c

View file

@ -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
],
},
}