mirror of
https://github.com/protomaps/PMTiles.git
synced 2026-02-04 10:51:07 +00:00
handle case where there are not root tiles, only leaf directories [#13]
This commit is contained in:
@@ -95,8 +95,10 @@ class Writer:
|
|||||||
if len(leafdir_tiles):
|
if len(leafdir_tiles):
|
||||||
self.write_leafdir(leafdir_tiles,leafdir_len)
|
self.write_leafdir(leafdir_tiles,leafdir_len)
|
||||||
|
|
||||||
root = [(group[0],list(group[1])) for group in itertools.groupby(self.tiles,key=by_parent) if group[0][0] == 0][0]
|
root_tiles = []
|
||||||
root_tiles = root[1]
|
root = [(group[0],list(group[1])) for group in itertools.groupby(self.tiles,key=by_parent) if group[0][0] == 0]
|
||||||
|
if root:
|
||||||
|
root_tiles = root[0][1]
|
||||||
self.f.seek(0)
|
self.f.seek(0)
|
||||||
self.write_header(metadata,len(root_tiles) + len(self.leaves))
|
self.write_header(metadata,len(root_tiles) + len(self.leaves))
|
||||||
for entry in root_tiles:
|
for entry in root_tiles:
|
||||||
|
|||||||
Reference in New Issue
Block a user