Wrong computation of min/max at low level
The following simple test on a 4 cells tile fails.
The min/max kd-tree should have only one level, corresponding to merging
the two columns together sideways.
However, it appears that at the first level, min/max are already
computed using the 4 cells,
and not only 2 cells on equal rows
@Test
public void testIssueWrongMinMax() throws RuggedException {
MinMaxTreeTile tile = new MinMaxTreeTileFactory().createTile();
tile.setGeometry(1.0, 2.0, 0.1, 0.2, 2, 2);
tile.setElevation(0, 0, 1.0);
tile.setElevation(0, 1, 2.0);
tile.setElevation(1, 0, 3.0);
tile.setElevation(1, 1, 4.0);
tile.tileUpdateCompleted();
Assert.assertEquals(1.0, tile.getMinElevation(0, 0, 0), 1.0e-10);
Assert.assertEquals(3.0, tile.getMinElevation(1, 0, 0), 1.0e-10);
Assert.assertEquals(2.0, tile.getMaxElevation(0, 0, 0), 1.0e-10);
Assert.assertEquals(4.0, tile.getMaxElevation(1, 0, 0), 1.0e-10);
}
(from redmine: issue id 189, created on 2015-02-03, closed on 2016-02-10)