1 | <?php |
||
14 | class SRTM4Provider extends AbstractGeoTIFFProvider |
||
15 | { |
||
16 | /** @var int */ |
||
17 | const MAX_LATITUDE = 60; |
||
18 | |||
19 | /** @var int */ |
||
20 | const MAX_LONGITUDE = 180; |
||
21 | |||
22 | /** @var float */ |
||
23 | const DEGREES_PER_TILE = 5.0; |
||
24 | |||
25 | /** @var float */ |
||
26 | protected $CurrentTileHorizontalReference; |
||
27 | |||
28 | /** @var float */ |
||
29 | protected $CurrentTileVerticalReference; |
||
30 | |||
31 | /** @var float top left latitude */ |
||
32 | protected $CurrentTileLatitude; |
||
33 | |||
34 | /** @var float top left longitude */ |
||
35 | protected $CurrentTileLongitude; |
||
36 | |||
37 | /** @var string */ |
||
38 | protected $FilenameFormat = 'srtm_%02d_%02d.tif'; |
||
39 | |||
40 | 8 | public function initResourceReader() |
|
44 | |||
45 | /** |
||
46 | * @param $format |
||
47 | */ |
||
48 | public function setFilenameFormat($format) |
||
52 | |||
53 | /** |
||
54 | * @param float $latitude |
||
55 | * @param float $longitude |
||
56 | * @return string |
||
57 | * @throws \InvalidArgumentException |
||
58 | */ |
||
59 | 7 | protected function getFilenameFor($latitude, $longitude) |
|
65 | |||
66 | /** |
||
67 | * @param float $latitude |
||
68 | * @param float $longitude |
||
69 | */ |
||
70 | 7 | protected function loadTileReferencesFor($latitude, $longitude) |
|
91 | |||
92 | /** |
||
93 | * @param float $latitude |
||
94 | * @param float $longitude |
||
95 | * @return float[] array(row, col) |
||
96 | */ |
||
97 | 6 | protected function getExactRowAndColFor($latitude, $longitude) |
|
104 | } |
||
105 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.