| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 74 | public function ST_SummaryStats($geo = null, $band = 1) |
||
| 75 | { |
||
| 76 | $sql = sprintf(' |
||
| 77 | SELECT |
||
| 78 | (ST_SummaryStats(%2$s, %3$d)).* |
||
| 79 | FROM %1$s', |
||
| 80 | $this->tableName, |
||
| 81 | $this->rasterColumn, |
||
| 82 | $band |
||
| 83 | ); |
||
| 84 | |||
| 85 | $sql .= $geo ? sprintf(' |
||
| 86 | WHERE ST_Intersects(%1$s, ST_GeomFromText(\'%2$s\', %3$d))', |
||
| 87 | $this->rasterColumn, |
||
| 88 | ...GIS::split_ewkt(GIS::array_to_ewkt($geo)) |
||
| 89 | ) : ''; |
||
| 90 | |||
| 91 | return DB::query($sql)->first(); |
||
| 92 | } |
||
| 127 |