Skip to content

Commit db9611f

Browse files
committed
remove prints
1 parent ac4883d commit db9611f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

label_maker/utils.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def download_tile_tms(tile, imagery, folder, kwargs):
4040
over_zoom = kwargs.get('over_zoom') or 0
4141
new_zoom = over_zoom + kwargs.get('zoom')
4242
if over_zoom:
43+
print('creating supertiles')
4344
#get children
4445
child_tiles = children(int(tile[0]), int(tile[1]), int(tile[2]), zoom=new_zoom)
4546
child_tiles.sort()
@@ -56,13 +57,14 @@ def download_tile_tms(tile, imagery, folder, kwargs):
5657
with rasterio.open(tile_img, 'w', driver='jpeg', height=new_dim,
5758
width=new_dim, count=3, dtype=rasterio.uint8) as w:
5859
for num, t in enumerate(child_tiles):
59-
print(t)
6060
t = [str(t[0]), str(t[1]), str(t[2])]
61-
#print(t)
6261
r = requests.get(url(t, imagery),
6362
auth=kwargs.get('http_auth'))
6463
img = np.array(Image.open(io.BytesIO(r.content)), dtype=np.uint8)
65-
img = img.reshape((256, 256, 4)) #4 channels returned from some endpoints, but not all
64+
try:
65+
img = img.reshape((256, 256, 3)) #4 channels returned from some endpoints, but not all
66+
except ValueError:
67+
img = img.reshape((256, 256, 4))
6668
img = img[:, :, :3]
6769
img = np.rollaxis(img, 2, 0)
6870
w.write(img, window=w_lst[num])

0 commit comments

Comments
 (0)