Skip to content

Commit

Permalink
fix interpolation in abstract file provider
Browse files Browse the repository at this point in the history
Order of arguments was mixed.
  • Loading branch information
laufhannes committed Aug 26, 2016
1 parent a94d504 commit 6a10eb2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Provider/AbstractFileProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ protected function getInterpolatedElevationFor($exactRowValue, $exactColValue)
$this->guessInvalidValuesOnBox($elevationOnBoundingBox);

return $this->Interpolation->interpolate(
($exactRowValue - $row),
($exactColValue - $col),
($exactRowValue - $row),
$elevationOnBoundingBox
);
}
Expand Down
12 changes: 6 additions & 6 deletions src/Tests/Provider/GeoTIFF/SRTM4ProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,22 +115,22 @@ public function testSingleElevationInGermany()
{
$this->checkFile('srtm_38_03.tif');

$this->assertEquals(238, $this->Provider->getElevation(49.444722, 7.768889));
$this->assertEquals(237, $this->Provider->getElevation(49.444722, 7.768889));
}

public function testThatUnknownElevationInSydneyIsGuessedBySurroundingValues()
{
$this->checkFile('srtm_67_19.tif');

$this->assertEquals(3, $this->Provider->getElevation(-33.8705667, 151.1486337));
$this->assertEquals(4, $this->Provider->getElevation(-33.8705667, 151.1486337));
}

public function testMultipleElevationsInSydney()
{
$this->checkFile('srtm_67_19.tif');

$this->assertEquals(
[3, 3, 2],
[4, 4, 3],
$this->Provider->getElevations(
[-33.8706555, -33.8705667, -33.8704860],
[151.1486918, 151.1486337, 151.1485585]
Expand All @@ -143,7 +143,7 @@ public function testLocationsInLondonLondon()
$this->checkFile('srtm_36_02.tif');

$this->assertEquals(
[18, 18, 21],
[20, 19, 19],
$this->Provider->getElevations(
[51.5073509, 51.5074509, 51.5075509],
[-0.1277583, -0.1278583, -0.1279583]
Expand All @@ -156,7 +156,7 @@ public function testLocationsInWindhoek()
$this->checkFile('srtm_40_17.tif');

$this->assertEquals(
[1666, 1669, 1671],
[1668, 1671, 1672],
$this->Provider->getElevations(
[-22.5700, -22.5705, -22.5710],
[17.0836, 17.0841, 17.0846]
Expand All @@ -169,7 +169,7 @@ public function testNewYork()
$this->checkFile('srtm_22_04.tif');

$this->assertEquals(
[22, 25, 41],
[26, 29, 39],
$this->Provider->getElevations(
[40.7127, 40.7132, 40.7137],
[-74.0059, -74.0064, -74.0069]
Expand Down

0 comments on commit 6a10eb2

Please sign in to comment.