diff --git a/python/pmtiles/tile.py b/python/pmtiles/tile.py index 692ef57..c1182dc 100644 --- a/python/pmtiles/tile.py +++ b/python/pmtiles/tile.py @@ -85,7 +85,7 @@ def tileid_to_zxy(tile_id): def find_tile(entries, tile_id): m = 0 n = len(entries) - 1 - while m < n: + while m <= n: k = (n + m) >> 1 c = tile_id - entries[k].tile_id if c > 0: diff --git a/python/pmtiles/v2.py b/python/pmtiles/v2.py index 50e132e..c2f9095 100644 --- a/python/pmtiles/v2.py +++ b/python/pmtiles/v2.py @@ -1,3 +1,4 @@ +import json from collections import namedtuple