tilematrix icon indicating copy to clipboard operation
tilematrix copied to clipboard

rounding error causes snap_bounds() to fail

Open ungarj opened this issue 4 years ago • 0 comments

the following test fails at zoom 15:

def test_snap_bounds_edge_cases():
    # as zoom level increases, so increases the potential rounding errors
    tp = TilePyramid("geodetic")
    for zoom in range(18):
        snapped = snap_bounds(bounds=tp.bounds, tile_pyramid=tp, zoom=zoom)
        assert snapped == tp.bounds

at some point the check whether a given point hits the border between two tiles fails which subsequently causes the snap_bounds function to return a tile outside of the tile matrix

ungarj avatar Mar 01 '21 17:03 ungarj