From 48195fa495eaab516f4d8b6f1f2b59976422bdf1 Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Sat, 6 Feb 2016 12:22:23 -0800 Subject: [PATCH] fix setting type=h-measure on trips --- compass/app/Jobs/TripComplete.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compass/app/Jobs/TripComplete.php b/compass/app/Jobs/TripComplete.php index 97bbe4e..2689800 100644 --- a/compass/app/Jobs/TripComplete.php +++ b/compass/app/Jobs/TripComplete.php @@ -182,6 +182,7 @@ class TripComplete extends Job implements SelfHandling, ShouldQueue $startTime = strtotime($features[0]->properties['timestamp']); $endTime = strtotime($features[count($features)-1]->properties['timestamp']); $duration = $endTime - $startTime; + $params['trip']['properties']['duration']['type'] = 'h-measure'; $params['trip']['properties']['duration']['properties']['num'] = $duration; $params['trip']['properties']['duration']['properties']['unit'] = 'second'; Log::debug("Overriding duration to $duration"); @@ -199,6 +200,7 @@ class TripComplete extends Job implements SelfHandling, ShouldQueue $last = $p; } if($distance) { + $params['trip']['properties']['distance']['type'] = 'h-measure'; $params['trip']['properties']['distance']['properties']['num'] = $distance; $params['trip']['properties']['distance']['properties']['unit'] = 'meter'; Log::debug("Overriding distance to $distance");