Skip to content

Update argument list of download_tile_tms #157

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Dec 13, 2019
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion label_maker/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def class_test(value):

# get image acquisition function based on imagery string
image_function = get_image_function(imagery)
kwargs['imagery_offset'] = imagery_offset

for tile in tiles:
image_function(tile, imagery, tiles_dir, imagery_offset, kwargs)
image_function(tile, imagery, tiles_dir, kwargs)
6 changes: 3 additions & 3 deletions label_maker/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def download_tile_tms(tile, imagery, folder, kwargs):
w.write(r.content)
return tile_img

def get_tile_tif(tile, imagery, folder, imagery_offset, kwargs):
def get_tile_tif(tile, imagery, folder, kwargs):
"""
Read a GeoTIFF with a window corresponding to a TMS tile

Expand All @@ -46,7 +46,7 @@ def get_tile_tif(tile, imagery, folder, imagery_offset, kwargs):
http://www.cogeo.org/in-depth.html
"""
bound = bounds(*[int(t) for t in tile.split('-')])
imagery_offset = imagery_offset or [0, 0]
imagery_offset = kwargs.get('imagery_offset') or [0, 0]
with rasterio.open(imagery) as src:
x_res, y_res = src.transform[0], src.transform[4]
p1 = Proj({'init': 'epsg:4326'})
Expand Down Expand Up @@ -88,7 +88,7 @@ def get_tile_tif(tile, imagery, folder, imagery_offset, kwargs):

return tile_img

def get_tile_wms(tile, imagery, folder, imagery_offset, kwargs):
def get_tile_wms(tile, imagery, folder, kwargs):
"""
Read a WMS endpoint with query parameters corresponding to a TMS tile

Expand Down