Skip to content
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

Merged
merged 5 commits into from
Mar 5, 2024
Merged

Conversation

Gigaszi
Copy link
Contributor

@Gigaszi Gigaszi commented Feb 12, 2024

Closes #371

sketch_map_tool/tasks.py Outdated Show resolved Hide resolved
sketch_map_tool/upload_processing/qr_code_reader.py Outdated Show resolved Hide resolved
sketch_map_tool/tasks.py Outdated Show resolved Hide resolved
# 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:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def get_attribution_text(layer: Layer) -> BytesIO:
def get_attribution_file(layer: Layer) -> BytesIO:

Comment on lines 126 to 128
for layer in layers:
with ZipFile(buffer, "a") as zip_file:
zip_file.writestr("attributions.txt", get_attribution_text(layer).read())
Copy link
Collaborator

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.

@matthiasschaub matthiasschaub merged commit 502dea4 into main Mar 5, 2024
1 check passed
@matthiasschaub matthiasschaub deleted the attribution-file branch March 5, 2024 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

write attribution to text file and add it to raster result zip
2 participants