@@ -59,6 +59,8 @@ |
||
| 59 | 59 | |
| 60 | 60 | $output = `$cmd`; |
| 61 | 61 | |
| 62 | - if (preg_match_all('/\sBand\s*(\d+):\s*Value:\s*([\d\.\-]+)/', $output, $matches)) return array_combine($matches[1], $matches[2]); |
|
| 62 | + if (preg_match_all('/\sBand\s*(\d+):\s*Value:\s*([\d\.\-]+)/', $output, $matches)) { |
|
| 63 | + return array_combine($matches[1], $matches[2]); |
|
| 64 | + } |
|
| 63 | 65 | } |
| 64 | 66 | } |
@@ -44,9 +44,13 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | public static function to_ewkt($geo) |
| 46 | 46 | { |
| 47 | - if (is_string($geo)) return $geo; |
|
| 47 | + if (is_string($geo)) { |
|
| 48 | + return $geo; |
|
| 49 | + } |
|
| 48 | 50 | |
| 49 | - if ($geo instanceof DBGeography) $geo = $geo->getValue(); |
|
| 51 | + if ($geo instanceof DBGeography) { |
|
| 52 | + $geo = $geo->getValue(); |
|
| 53 | + } |
|
| 50 | 54 | |
| 51 | 55 | $type = isset($geo['type']) ? strtoupper($geo['type']) : null; |
| 52 | 56 | $srid = isset($geo['srid']) ? $geo['srid'] : Config::inst()->get(self::class, 'default_srid'); |
@@ -80,11 +84,15 @@ discard block |
||
| 80 | 84 | |
| 81 | 85 | public static function to_array($geo) |
| 82 | 86 | { |
| 83 | - if ($geo instanceof DBGeography) $geo = $geo->getValue(); |
|
| 87 | + if ($geo instanceof DBGeography) { |
|
| 88 | + $geo = $geo->getValue(); |
|
| 89 | + } |
|
| 84 | 90 | |
| 85 | 91 | if (is_array($geo)) { |
| 86 | 92 | |
| 87 | - if (isset($geo['coordinates'])) return $geo; |
|
| 93 | + if (isset($geo['coordinates'])) { |
|
| 94 | + return $geo; |
|
| 95 | + } |
|
| 88 | 96 | |
| 89 | 97 | switch (true) { |
| 90 | 98 | case is_numeric($geo[0]): $type = 'Point'; break; |