@@ -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 | /** |
@@ -73,11 +73,11 @@ discard block |
||
73 | 73 | { |
74 | 74 | |
75 | 75 | //first (major) letter is the 500km grid sq, origin at -1000000, -500000 |
76 | - $majorEasting = strpos(self::GRID_LETTERS, $ref[0]) % 5 * 500000 - 1000000; |
|
76 | + $majorEasting = strpos(self::GRID_LETTERS, $ref[0]) % 5 * 500000 - 1000000; |
|
77 | 77 | $majorNorthing = (floor(strpos(self::GRID_LETTERS, $ref[0]) / 5)) * 500000 - 500000; |
78 | 78 | |
79 | 79 | //second (minor) letter is 100km grid sq, origin at 0,0 of this square |
80 | - $minorEasting = strpos(self::GRID_LETTERS, $ref[1]) % 5 * 100000; |
|
80 | + $minorEasting = strpos(self::GRID_LETTERS, $ref[1]) % 5 * 100000; |
|
81 | 81 | $minorNorthing = (floor(strpos(self::GRID_LETTERS, $ref[1]) / 5)) * 100000; |
82 | 82 | |
83 | 83 | $easting = $majorEasting + $minorEasting + (substr($ref, 2, 3) * 100); |
@@ -103,13 +103,13 @@ discard block |
||
103 | 103 | $adjustedY = $this->y + 500000; |
104 | 104 | $majorSquaresEast = floor($adjustedX / 500000); |
105 | 105 | $majorSquaresNorth = floor($adjustedY / 500000); |
106 | - $majorLetterIndex = (int)(5 * $majorSquaresNorth + $majorSquaresEast); |
|
106 | + $majorLetterIndex = (int) (5 * $majorSquaresNorth + $majorSquaresEast); |
|
107 | 107 | $majorLetter = substr(self::GRID_LETTERS, $majorLetterIndex, 1); |
108 | 108 | |
109 | 109 | //second (minor) letter is 100km grid sq, origin at 0,0 of this square |
110 | 110 | $minorSquaresEast = $easting[0] % 5; |
111 | 111 | $minorSquaresNorth = $northing[0] % 5; |
112 | - $minorLetterIndex = (int)(5 * $minorSquaresNorth + $minorSquaresEast); |
|
112 | + $minorLetterIndex = (int) (5 * $minorSquaresNorth + $minorSquaresEast); |
|
113 | 113 | $minorLetter = substr(self::GRID_LETTERS, $minorLetterIndex, 1); |
114 | 114 | |
115 | 115 | return $majorLetter . $minorLetter . substr($easting, 1, 3) . substr($northing, 1, 3); |
@@ -132,13 +132,13 @@ discard block |
||
132 | 132 | $adjustedY = $this->y + 500000; |
133 | 133 | $majorSquaresEast = floor($adjustedX / 500000); |
134 | 134 | $majorSquaresNorth = floor($adjustedY / 500000); |
135 | - $majorLetterIndex = (int)(5 * $majorSquaresNorth + $majorSquaresEast); |
|
135 | + $majorLetterIndex = (int) (5 * $majorSquaresNorth + $majorSquaresEast); |
|
136 | 136 | $majorLetter = substr(self::GRID_LETTERS, $majorLetterIndex, 1); |
137 | 137 | |
138 | 138 | //second (minor) letter is 100km grid sq, origin at 0,0 of this square |
139 | 139 | $minorSquaresEast = $easting[0] % 5; |
140 | 140 | $minorSquaresNorth = $northing[0] % 5; |
141 | - $minorLetterIndex = (int)(5 * $minorSquaresNorth + $minorSquaresEast); |
|
141 | + $minorLetterIndex = (int) (5 * $minorSquaresNorth + $minorSquaresEast); |
|
142 | 142 | $minorLetter = substr(self::GRID_LETTERS, $minorLetterIndex, 1); |
143 | 143 | |
144 | 144 | return $majorLetter . $minorLetter . substr($easting, 1, 4) . substr($northing, 1, 4); |
@@ -161,13 +161,13 @@ discard block |
||
161 | 161 | $adjustedY = $this->y + 500000; |
162 | 162 | $majorSquaresEast = floor($adjustedX / 500000); |
163 | 163 | $majorSquaresNorth = floor($adjustedY / 500000); |
164 | - $majorLetterIndex = (int)(5 * $majorSquaresNorth + $majorSquaresEast); |
|
164 | + $majorLetterIndex = (int) (5 * $majorSquaresNorth + $majorSquaresEast); |
|
165 | 165 | $majorLetter = substr(self::GRID_LETTERS, $majorLetterIndex, 1); |
166 | 166 | |
167 | 167 | //second (minor) letter is 100km grid sq, origin at 0,0 of this square |
168 | 168 | $minorSquaresEast = $easting[0] % 5; |
169 | 169 | $minorSquaresNorth = $northing[0] % 5; |
170 | - $minorLetterIndex = (int)(5 * $minorSquaresNorth + $minorSquaresEast); |
|
170 | + $minorLetterIndex = (int) (5 * $minorSquaresNorth + $minorSquaresEast); |
|
171 | 171 | $minorLetter = substr(self::GRID_LETTERS, $minorLetterIndex, 1); |
172 | 172 | |
173 | 173 | return $majorLetter . $minorLetter . substr($easting, 1, 5) . substr($northing, 1, 5); |
@@ -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); |