From dc91e5e6ebd1f887d83a8365f23ff3929bdeefea Mon Sep 17 00:00:00 2001 From: Tobias Eidelpes Date: Wed, 9 Jun 2021 18:27:11 +0200 Subject: [PATCH] Ignore traffic lights to the south --- .../entity_ident_service/entity_ident_server.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/entitiy_ident/entity_ident_service/entity_ident_server.py b/components/entitiy_ident/entity_ident_service/entity_ident_server.py index a87fd2f..3409e5e 100644 --- a/components/entitiy_ident/entity_ident_service/entity_ident_server.py +++ b/components/entitiy_ident/entity_ident_service/entity_ident_server.py @@ -54,16 +54,19 @@ def get_traffic_lights_geo(): }}, {"$redact": { "$cond": { - "if": {"$lte": ["$calculatedRange", "$range"]}, + "if": { + "$lte": ["$calculatedRange", "$range"] + }, "then": "$$KEEP", "else": "$$PRUNE" } }} ] ) + if lat < traffic_light['location'][1] ] - return json_util.dumps({'cursor': traffic_lights}) + return json_util.dumps({'cursor': traffic_lights[:1]}) if __name__ == '__main__':