-
Notifications
You must be signed in to change notification settings - Fork 19
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
Account for tilesize on RedShift records #179
Conversation
It's not guaranteed that we want the globe from z0-z9 in the TOI, for example
and (x between 0 and pow(2,z)-1) | ||
and (y between 0 and pow(2,z)-1) | ||
group by z, x, y | ||
order by z, x, y;""".format(days=redshift_days_to_query)) | ||
n_trr = cur.rowcount | ||
for (x, y, z) in cur: | ||
for (x, y, z, tile_size) in cur: |
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.
Don't need the parens here, but I know that @zerebubuth likes seeing them so up to you :)
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.
Indeed! I do like parens - mainly because I can't remember precedence rules or, as in this case, like being reminded that we're destructuring a tuple.
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 was being extra explicit with parens in the SQL above so I kept going in the Python here. 😄 I'm going to keep it.
from tile_traffic_v4 | ||
where (date >= dateadd(day, -{days}, current_date)) | ||
and (z between 10 and 16) | ||
and (z between 0 and 15) |
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.
Are we going to be pruning low zoom level tiles too? ie 0-10, err 0-9 now?
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 made this change because I didn't want to assume we always wanted to have zooms 0 through 9 in the TOI. In my sample configuration I have the whole Earth at z0-z9 as an "immortal" area, so it gets added to the TOI that way.
Follow of #178, #176.
Standardize on 512px-sized tiles in the tiles of interest by "zooming out" the records from RedShift if they don't specify 512px as the requested tile size.