Conditions | 4 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php |
||
51 | public function getValue($geo = null, $band = null) |
||
52 | { |
||
53 | $cmd = sprintf(' |
||
54 | gdallocationinfo -wgs84 %1$s %2$s %3$s', |
||
55 | $band ? sprintf('-b %d', $band) : '', |
||
56 | $this->getFullPath(), |
||
57 | $geo ? sprintf('%f %f', ...GIS::reproject(GIS::to_array($geo), 4326)['coordinates']) : '' |
||
58 | ); |
||
59 | |||
60 | $output = `$cmd`; |
||
61 | |||
62 | if (preg_match_all('/\sBand\s*(\d+):\s*Value:\s*([\d\.\-]+)/', $output, $matches)) return array_combine($matches[1], $matches[2]); |
||
63 | } |
||
65 |