@Test
public void testGetHeight()
{

    // data access has same coordinate system as graphical or UI systems have (or the original DEM data has).
    // But HeightTile has lat,lon system ('mathematically')
    int width = 10;
    HeightTile instance = new HeightTile(0, 0, width, 1e-6, 10);
    DataAccess heights = new RAMDirectory().find("tmp");
    heights.create(2 * 10 * 10);
    instance.setHeights(heights);
    init(heights, width, 1);
    // x,y=1,7
    heights.setShort(2 * (7 * width + 1), (short) 70);
    // x,y=2,9
    heights.setShort(2 * (9 * width + 2), (short) 90);
    assertEquals(1, instance.getHeight(5, 5), 1e-3);
    assertEquals(70, instance.getHeight(2.5, 1.5), 1e-3);
    // edge cases for one tile with the boundaries [min,min+degree/width) for lat and lon
    assertEquals(1, instance.getHeight(3, 2), 1e-3);
    assertEquals(70, instance.getHeight(2, 1), 1e-3);
    // edge cases for the whole object        
    assertEquals(1, instance.getHeight(+1.0, 2), 1e-3);
    assertEquals(90, instance.getHeight(0.5, 2.5), 1e-3);
    assertEquals(90, instance.getHeight(0.0, 2.5), 1e-3);
    assertEquals(1, instance.getHeight(+0.0, 3), 1e-3);
    assertEquals(1, instance.getHeight(-0.5, 3.5), 1e-3);
    assertEquals(1, instance.getHeight(-0.5, 3.0), 1e-3);
    // fall back to "2,9" if within its boundaries
    assertEquals(90, instance.getHeight(-0.5, 2.5), 1e-3);
    assertEquals(1, instance.getHeight(0, 0), 1e-3);
    assertEquals(1, instance.getHeight(9, 10), 1e-3);
    assertEquals(1, instance.getHeight(10, 9), 1e-3);
    assertEquals(1, instance.getHeight(10, 10), 1e-3);
    // no error
    assertEquals(1, instance.getHeight(10.5, 5), 1e-3);
    assertEquals(1, instance.getHeight(-0.5, 5), 1e-3);
    assertEquals(1, instance.getHeight(1, -0.5), 1e-3);
    assertEquals(1, instance.getHeight(1, 10.5), 1e-3);
}