Browse Source

fix setting type=h-measure on trips

pull/5/head
Aaron Parecki 9 years ago
parent
commit
48195fa495
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      compass/app/Jobs/TripComplete.php

+ 2
- 0
compass/app/Jobs/TripComplete.php View File

@ -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");

Loading…
Cancel
Save