diff trafficintelligence/events.py @ 1291:46a30ce1a2e4

dealing with modified table structures
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Thu, 15 Aug 2024 17:04:16 -0400
parents 9f1711a85c56
children
line wrap: on
line diff
--- a/trafficintelligence/events.py	Fri Jul 26 21:53:03 2024 +0200
+++ b/trafficintelligence/events.py	Thu Aug 15 17:04:16 2024 -0400
@@ -217,7 +217,7 @@
         self.addIndicator(indicators.SeverityIndicator(Interaction.indicatorNames[5], speedDifferentials))
 
         # if we have features, compute other indicators
-        if self.roadUser1.hasFeatures() and self.roadUser2.hasFeatures():
+        if self.roadUser1.hasFeatures() and self.roadUser2.hasFeatures() and len(self.roadUser1.getFeatures())>1 and len(self.roadUser2.getFeatures())>1:
             minDistances={}
             for instant in self.timeInterval:
                 minDistances[instant] = moving.MovingObject.minDistance(self.roadUser1, self.roadUser2, instant)