-
Notifications
You must be signed in to change notification settings - Fork 21
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
[Needs review] add zoom range "min..max" options for burn + other changes #26
base: main
Are you sure you want to change the base?
Conversation
👋 @dnomadb I've updated the code and added a custom
|
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.
G7
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.
for t in tiles: | ||
click.echo(t.tolist()) | ||
tiles = ( | ||
burntiles.burn(features, zoom) for zoom in range(zoom[0], zoom[1] + 1) |
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.
We don't have to re-burn for every zoom; we can use the maxzoom to generate the tile-cover, then:
tiles[:, :2] >>= 1
tiles[:, 2] -= 1
np.unique(tiles, axis=0)
This will output the parents of tiles
. cc @pratikyadav
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.
yeah makes sense 👍
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.
Explain @dnomadb ? Does that not risk false positives, sweeping in small child tiles that are outside the features?
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.
@sgillies y of course!
A feature that covers a tile at zoom z will always cover said tiles at zooms z-n. False positives would be a (huge) risk going to higher zooms but if we perform the tile cover at the maxzoom of the provided range, we can then derive lower zooms directly from this array.
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.
Right! Thanks, I must have had some min/max zoom confusion in my head at the end of the day.
👋 @dnomadb
I think having the possibility to pass a zoom range to the
burn
command could be a nice feature (at least for myself). I tried to apply the same logic at in rio-mbtiles where we pass the Min Max zoom as amin..max
string.I know this could be achieve with a bash onliner but you know I don't love bash 😄
I also did some other change to improve code readability and help.
I'll work on the tests as soon if we agree on this options
cc @sgillies