@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * PHPCoord |
|
| 4 | - * @package PHPCoord |
|
| 5 | - * @author Jonathan Stott |
|
| 6 | - * @author Doug Wright |
|
| 7 | - */ |
|
| 3 | + * PHPCoord |
|
| 4 | + * @package PHPCoord |
|
| 5 | + * @author Jonathan Stott |
|
| 6 | + * @author Doug Wright |
|
| 7 | + */ |
|
| 8 | 8 | namespace PHPCoord; |
| 9 | 9 | |
| 10 | 10 | /** |
@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * PHPCoord |
|
| 4 | - * @package PHPCoord |
|
| 5 | - * @author Jonathan Stott |
|
| 6 | - * @author Doug Wright |
|
| 7 | - */ |
|
| 3 | + * PHPCoord |
|
| 4 | + * @package PHPCoord |
|
| 5 | + * @author Jonathan Stott |
|
| 6 | + * @author Doug Wright |
|
| 7 | + */ |
|
| 8 | 8 | namespace PHPCoord; |
| 9 | 9 | |
| 10 | 10 | /** |
@@ -72,11 +72,11 @@ discard block |
||
| 72 | 72 | { |
| 73 | 73 | |
| 74 | 74 | //first (major) letter is the 500km grid sq, origin at -1000000, -500000 |
| 75 | - $majorEasting = strpos(self::GRID_LETTERS, $ref[0]) % 5 * 500000 - 1000000; |
|
| 75 | + $majorEasting = strpos(self::GRID_LETTERS, $ref[0]) % 5 * 500000 - 1000000; |
|
| 76 | 76 | $majorNorthing = (floor(strpos(self::GRID_LETTERS, $ref[0]) / 5)) * 500000 - 500000; |
| 77 | 77 | |
| 78 | 78 | //second (minor) letter is 100km grid sq, origin at 0,0 of this square |
| 79 | - $minorEasting = strpos(self::GRID_LETTERS, $ref[1]) % 5 * 100000; |
|
| 79 | + $minorEasting = strpos(self::GRID_LETTERS, $ref[1]) % 5 * 100000; |
|
| 80 | 80 | $minorNorthing = (floor(strpos(self::GRID_LETTERS, $ref[1]) / 5)) * 100000; |
| 81 | 81 | |
| 82 | 82 | $easting = $majorEasting + $minorEasting + (substr($ref, 2, 3) * 100); |
@@ -102,13 +102,13 @@ discard block |
||
| 102 | 102 | $adjustedY = $this->y + 500000; |
| 103 | 103 | $majorSquaresEast = floor($adjustedX / 500000); |
| 104 | 104 | $majorSquaresNorth = floor($adjustedY / 500000); |
| 105 | - $majorLetterIndex = (int)(5 * $majorSquaresNorth + $majorSquaresEast); |
|
| 105 | + $majorLetterIndex = (int) (5 * $majorSquaresNorth + $majorSquaresEast); |
|
| 106 | 106 | $majorLetter = self::GRID_LETTERS[$majorLetterIndex]; |
| 107 | 107 | |
| 108 | 108 | //second (minor) letter is 100km grid sq, origin at 0,0 of this square |
| 109 | 109 | $minorSquaresEast = $easting[0] % 5; |
| 110 | 110 | $minorSquaresNorth = $northing[0] % 5; |
| 111 | - $minorLetterIndex = (int)(5 * $minorSquaresNorth + $minorSquaresEast); |
|
| 111 | + $minorLetterIndex = (int) (5 * $minorSquaresNorth + $minorSquaresEast); |
|
| 112 | 112 | $minorLetter = self::GRID_LETTERS[$minorLetterIndex]; |
| 113 | 113 | |
| 114 | 114 | return $majorLetter . $minorLetter . substr($easting, 1, 3) . substr($northing, 1, 3); |
@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * PHPCoord |
|
| 4 | - * @package PHPCoord |
|
| 5 | - * @author Jonathan Stott |
|
| 6 | - * @author Doug Wright |
|
| 7 | - */ |
|
| 3 | + * PHPCoord |
|
| 4 | + * @package PHPCoord |
|
| 5 | + * @author Jonathan Stott |
|
| 6 | + * @author Doug Wright |
|
| 7 | + */ |
|
| 8 | 8 | namespace PHPCoord; |
| 9 | 9 | |
| 10 | 10 | /** |
@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * PHPCoord |
|
| 4 | - * @package PHPCoord |
|
| 5 | - * @author Jonathan Stott |
|
| 6 | - * @author Doug Wright |
|
| 7 | - */ |
|
| 3 | + * PHPCoord |
|
| 4 | + * @package PHPCoord |
|
| 5 | + * @author Jonathan Stott |
|
| 6 | + * @author Doug Wright |
|
| 7 | + */ |
|
| 8 | 8 | namespace PHPCoord; |
| 9 | 9 | |
| 10 | 10 | /** |
@@ -383,7 +383,7 @@ discard block |
||
| 383 | 383 | trigger_error('Current co-ordinates are in a non-WGS84 datum', E_USER_WARNING); |
| 384 | 384 | } |
| 385 | 385 | |
| 386 | - $longitudeZone = (int)(($this->lng + 180) / 6) + 1; |
|
| 386 | + $longitudeZone = (int) (($this->lng + 180) / 6) + 1; |
|
| 387 | 387 | |
| 388 | 388 | // Special zone for Norway |
| 389 | 389 | if ($this->lat >= 56 && $this->lat < 64 && $this->lng >= 3 && $this->lng < 12) { |
@@ -440,7 +440,7 @@ discard block |
||
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | $zones = "CDEFGHJKLMNPQRSTUVWXX"; |
| 443 | - $zoneIndex = (int)(($latitude + 80) / 8); |
|
| 443 | + $zoneIndex = (int) (($latitude + 80) / 8); |
|
| 444 | 444 | return $zones[$zoneIndex]; |
| 445 | 445 | } |
| 446 | 446 | |
@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * PHPCoord |
|
| 4 | - * @package PHPCoord |
|
| 5 | - * @author Jonathan Stott |
|
| 6 | - * @author Doug Wright |
|
| 7 | - */ |
|
| 3 | + * PHPCoord |
|
| 4 | + * @package PHPCoord |
|
| 5 | + * @author Jonathan Stott |
|
| 6 | + * @author Doug Wright |
|
| 7 | + */ |
|
| 8 | 8 | namespace PHPCoord; |
| 9 | 9 | |
| 10 | 10 | /** |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * PHPCoord |
|
| 4 | - * @package PHPCoord |
|
| 5 | - * @author Doug Wright |
|
| 6 | - */ |
|
| 3 | + * PHPCoord |
|
| 4 | + * @package PHPCoord |
|
| 5 | + * @author Doug Wright |
|
| 6 | + */ |
|
| 7 | 7 | namespace PHPCoord; |
| 8 | 8 | |
| 9 | 9 | /** |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * PHPCoord |
|
| 4 | - * @package PHPCoord |
|
| 5 | - * @author Doug Wright |
|
| 6 | - */ |
|
| 3 | + * PHPCoord |
|
| 4 | + * @package PHPCoord |
|
| 5 | + * @author Doug Wright |
|
| 6 | + */ |
|
| 7 | 7 | namespace PHPCoord; |
| 8 | 8 | |
| 9 | 9 | /** |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | public static function fromSixFigureReference($ref) |
| 68 | 68 | { |
| 69 | 69 | |
| 70 | - $easting = strpos(self::GRID_LETTERS, $ref[0]) % 5 * 100000 + (substr($ref, 1, 3) * 100); |
|
| 70 | + $easting = strpos(self::GRID_LETTERS, $ref[0]) % 5 * 100000 + (substr($ref, 1, 3) * 100); |
|
| 71 | 71 | $northing = (floor(strpos(self::GRID_LETTERS, $ref[0]) / 5)) * 100000 + (substr($ref, 4, 3) * 100); |
| 72 | 72 | |
| 73 | 73 | return new IrishGridRef($easting, $northing); |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | //100km grid sq, origin at 0,0 |
| 89 | 89 | $minorSquaresEast = $easting[0] % 5; |
| 90 | 90 | $minorSquaresNorth = $northing[0] % 5; |
| 91 | - $minorLetterIndex = (int)(5 * $minorSquaresNorth + $minorSquaresEast); |
|
| 91 | + $minorLetterIndex = (int) (5 * $minorSquaresNorth + $minorSquaresEast); |
|
| 92 | 92 | $minorLetter = substr(self::GRID_LETTERS, $minorLetterIndex, 1); |
| 93 | 93 | |
| 94 | 94 | return $minorLetter . substr($easting, 1, 3) . substr($northing, 1, 3); |