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

add autorescaling to avoid image creation errors #391

Merged
merged 4 commits into from
May 17, 2021
Merged

Conversation

vincentsarago
Copy link
Member

@vincentsarago vincentsarago commented May 13, 2021

closes #390

This PR does:

  • add data type rescaling when we know the output driver will raise an error (e.g float -> uint8 for PNG)

Why the auto-rescaling is only in ImageData.render and not in rio_tiler.utils.render?

The rescale method (rio_tiler.utils.linear_rescale) requires a mask in argument but in rio_tiler.utils.render the mask is either optional or deleted. In the ImageData object, the mask will always be defined.

rio_tiler/models.py Outdated Show resolved Hide resolved
@vincentsarago vincentsarago merged commit d27d5c0 into master May 17, 2021
@vincentsarago vincentsarago deleted the autoRescaling branch May 17, 2021 15:24
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.

rescale data to avoid Driver error
2 participants