-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat(sketch-map): add attributions file #373
Conversation
sketch_map_tool/tasks.py
Outdated
# r = interim result | ||
r = db_client_celery.select_file(sketch_map_id) | ||
r = to_array(r) | ||
r = clip(r, map_frames[uuid]) | ||
r = georeference(r, bbox) | ||
return r | ||
|
||
def get_attribution_text(layer: Layer) -> BytesIO: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def get_attribution_text(layer: Layer) -> BytesIO: | |
def get_attribution_file(layer: Layer) -> BytesIO: |
sketch_map_tool/tasks.py
Outdated
for layer in layers: | ||
with ZipFile(buffer, "a") as zip_file: | ||
zip_file.writestr("attributions.txt", get_attribution_text(layer).read()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would move the iteration through the layers to get_attribution_text
. -> Write just a single attributions.txt with all attributions in it.
The way it is currently implemented, it would overwrite attibutions.txt in the case of multiple layers.
Closes #371