-
Notifications
You must be signed in to change notification settings - Fork 1
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
Titiler/encoded alert tiles #166
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## dev #166 +/- ##
==========================================
+ Coverage 80.07% 80.24% +0.17%
==========================================
Files 59 59
Lines 1927 1954 +27
==========================================
+ Hits 1543 1568 +25
- Misses 384 386 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
This looks like we talked about last week during the huddle, @solomon-negusse. Nice work extending the existing alerts! 💪
I only have one suggested change that I think should be considered (besides the typo).
# Using the same method used in Data API to provide the confidence encoding | ||
# GFW Flagship expects in the alpha channel where the three alerts' confidence | ||
# levels are packed in the alpha channel with 2 bits for each alert (starting at 3rd). | ||
# The values used are follows (bit layout and decimal value): | ||
# low confidence | ||
# GLADL GLADS2 RADD Unused | ||
# 00 00 01 00 = 4 (decimal) | ||
# high confidence | ||
# GLADL GLADS2 RADD Unused | ||
# 00 00 10 00 = 8 (decimal) | ||
# highest confidence | ||
# GLADL GLADS2 RADD Unused | ||
# 00 01 10 00 = 24 (decimal) | ||
# More explanation: https://github.com/wri/gfw-data-api/blob/master/app/tasks/raster_tile_cache_assets/symbology.py#L92 |
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.
Love this documentation, @solomon-negusse! 😍 📝
def create_encoded_alpha(self): | ||
"""To be overridden by alert types that implement it.""" | ||
return self.create_true_color_alpha() |
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 understand why this method is implemented this way. But, do you think it is likely to cause confusion?
Should we log what we're doing here? Basically, "Hey, I know you asked for an encoded alpha, but your specialized alert class doesn't support that." And we return the true color alpha just like you're doing.
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.
Good idea. An alternative I considered was to not provide a default behavior and return rgb instead of rgba if this method isn't provided by the alert class, but went with this because we expect an intensity layer as input so it makes sense to act on that.
Co-authored-by: Gary Tempus <[email protected]>
…-cache into titiler/encoded-alert-tiles
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.
Thank you, @solomon-negusse!
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.
Looks good!
Pull request checklist
Please check if your PR fulfills the following requirements:
Pull request type
Please check the type of change your PR introduces:
What is the new behavior?
Does this introduce a breaking change?
Other information