| Total Complexity | 9 |
| Total Lines | 53 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | class Raster |
||
| 11 | { |
||
| 12 | use Configurable; |
||
| 13 | |||
| 14 | use Injectable; |
||
| 15 | |||
| 16 | private static $tile_renderer = 'raster_renderer'; |
||
|
|
|||
| 17 | |||
| 18 | protected $info; |
||
| 19 | |||
| 20 | public function searchableFields() |
||
| 21 | { |
||
| 22 | return [ |
||
| 23 | 'Band' => 'Band', |
||
| 24 | ]; |
||
| 25 | } |
||
| 26 | |||
| 27 | public function getFullPath() |
||
| 28 | { |
||
| 29 | return static::config()->full_path; |
||
| 30 | } |
||
| 31 | |||
| 32 | public function getSrid() |
||
| 33 | { |
||
| 34 | if (empty($this->info['srid'])) { |
||
| 35 | |||
| 36 | $cmd = sprintf(' |
||
| 37 | gdalsrsinfo -o wkt %1$s', |
||
| 38 | $this->getFullPath() |
||
| 39 | ); |
||
| 40 | |||
| 41 | $output = `$cmd`; |
||
| 42 | |||
| 43 | if (preg_match('/\WAUTHORITY\["EPSG","([^"]+)"\]\]$/', $output, $matches)) { |
||
| 44 | $this->info['srid'] = $matches[1]; |
||
| 45 | } |
||
| 46 | } |
||
| 47 | |||
| 48 | return $this->info['srid']; |
||
| 49 | } |
||
| 50 | |||
| 51 | public function getValue($geo = null, $band = null) |
||
| 63 | } |
||
| 64 | } |
||
| 65 |