| Total Complexity | 10 |
| Total Lines | 115 |
| 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 $tableName; |
||
| 19 | |||
| 20 | protected $rasterColumn; |
||
| 21 | |||
| 22 | protected $srid = 4326; |
||
| 23 | |||
| 24 | protected $dimensions; |
||
| 25 | |||
| 26 | protected $colorMap; |
||
| 27 | |||
| 28 | public function searchableFields() |
||
| 29 | { |
||
| 30 | return [ |
||
| 31 | 'Band' => 'Band', |
||
| 32 | ]; |
||
| 33 | } |
||
| 34 | |||
| 35 | public function getTableName() |
||
| 36 | { |
||
| 37 | return $this->tableName; |
||
| 38 | } |
||
| 39 | |||
| 40 | public function getRasterColumn() |
||
| 41 | { |
||
| 42 | return $this->rasterColumn; |
||
| 43 | } |
||
| 44 | |||
| 45 | public function getSrid() |
||
| 46 | { |
||
| 47 | return $this->srid; |
||
| 48 | } |
||
| 49 | |||
| 50 | public function getDimensions() |
||
| 51 | { |
||
| 52 | return $this->dimensions; |
||
| 53 | } |
||
| 54 | |||
| 55 | public function getColorMap() |
||
| 56 | { |
||
| 57 | return $this->colorMap; |
||
| 58 | } |
||
| 59 | |||
| 60 | public function ST_SRID() |
||
| 61 | { |
||
| 62 | $sql = sprintf(' |
||
| 63 | SELECT |
||
| 64 | ST_SRID(%2$s) srid |
||
| 65 | FROM %1$s |
||
| 66 | LIMIT 1', |
||
| 67 | $this->tableName, |
||
| 68 | $this->rasterColumn |
||
| 69 | ); |
||
| 70 | |||
| 71 | return DB::query($sql)->value(); |
||
| 72 | } |
||
| 73 | |||
| 74 | public function ST_SummaryStats($geo = null, $band = 1) |
||
| 92 | } |
||
| 93 | |||
| 94 | public function ST_Value($geo, $band = 1) |
||
| 95 | { |
||
| 96 | $split = GIS::split_ewkt(GIS::array_to_ewkt($geo)); |
||
| 125 | } |
||
| 126 | } |
||
| 127 |