Example #1
0
 /**
  * Correct elevation data
  * 
  * This method does directly update the route object.
  * 
  * @return boolean false if correction did not work
  */
 public function tryToCorrectElevation()
 {
     if (!$this->Route->hasPositionData()) {
         return false;
     }
     $Corrector = new Corrector();
     $Corrector->correctElevation($this->Route->latitudes(), $this->Route->longitudes());
     $result = $Corrector->getCorrectedElevation();
     if (!empty($result)) {
         $this->Route->set(Route\Object::ELEVATIONS_CORRECTED, $result);
         $this->Route->set(Route\Object::ELEVATIONS_SOURCE, $Corrector->getNameOfUsedStrategy());
         return true;
     }
     return false;
 }