php igc patch
Published by orion on Temmuz 7th, 2009 in php igc
There is a realy powerfull tool to convert igc files into gmap polygons or whatever you want, called PHP IGC ( official site here: https://sourceforge.net/projects/php-igc/)
But there is just a little problem with the setDetails method which has a statement like:
foreach ($this->records as $each) { if ($each['type'] == 'B') { if ($each['pressure_altitude']>$this->max_altitude) { $this->max_altitude = $each['pressure_altitude']; } elseif ($each['pressure_altitude'] < $this->min_altitude) { $this->min_altitude = $each['pressure_altitude']; } } } }
You need to change it to
if ($each->type == 'B') { if ($each->pressure_altitude>$this->max_altitude) { $this->max_altitude = $each->pressure_altitude; } elseif ($each->pressure_altitude< $this->min_altitude) { $this->min_altitude = $each->pressure_altitude; } }
because $each property is not an array, it's an object. hope this helps someone.
