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
Make locality thinning grids smaller #2040
Conversation
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.
If this is a 512 px tile size versus 256 issue, then should we try doubling the grid_width instead? Your example from 3 > 10 looks far too dense to me.
Sounds good. I was trying to roughly match the styled map from before thinning (where the client was doing all the thinning), and a plain doubling seemed to be missing some of the smaller localities. But here's a new round of screenshots with plain doubling:
|
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.
Looking good, let's see it in a build :)
Build says the numbers still aren't right. If Tilequeue is operating on a larger window (like 4x4 grid of requested tiles), then we should we instead apply multiplier to vector-datasource for an allowlisted list of config props values (like also for |
…eady multiplied by 2
Sounds like we're happy with this most recent change. So last couple things here before we merge:
|
We also need to fix the config and logic so it works for both Tilequeue and Tileserver, please. |
I haven't found a path to do that yet. I'll keep thinking. |
After talking with Travis for a bit this afternoon we weren't able to find an approach that handles both tileserver and tilequeue. I'm going to spend the rest of the evening trying to get The sticking point is that metatile-based builds run the functions in queries.yaml (like grid thinning) once for all the data in the metatile and the functions only get the |
queries.yaml
Outdated
@@ -1052,7 +1052,7 @@ post_process: | |||
end_zoom: 9 | |||
items_matching: { kind: locality } | |||
max_items: 1 | |||
grid_width: 3 | |||
grid_width: 52181.0113 |
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.
It's not obvious this is in meters... should the param name be grid_width_meters
?
Is the fractional meters necessary?
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 suppose they're not necessary, but using fractions means we get closer to exactly 3x3 subdivisions in a single 256px tile at this zoom level. If we go to integer values here, then the tiny subdivisions at the edge of the tile are slightly bigger and are more likely to get an extra feature in there.
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.
Changed to grid_width_meters
in 2eca280.
@@ -3189,8 +3183,8 @@ def keep_n_features_gridded(ctx): | |||
# Calculate the bucket to put this feature in. | |||
# Note that this purposefully allows for buckets outside the unpadded bounds | |||
# so we can bucketize the padding area, too. | |||
bucket_x = int((shape.x - minx) / bucket_width) | |||
bucket_y = int((shape.y - miny) / bucket_height) | |||
bucket_x = int((shape.x - minx) / grid_width) |
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.
Is this already flexible to whole number grid_width meters? It's rounding it to an int, so maybe? If it's already padded then seems like it's fine.
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.
It's rounding to an int after doing floating point math.
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.
Two nits but otherwise LGTM and works in a QA build.
Fix keep_n_gridded tests after changes in #2040
Extending #2001 with a few tweaks to the queries.yaml arguments for the locality thinning.
The
grid_width: 3
was way too small, resulting in way too few localities showing up:Changing to
grid_width: 10
results in a more reasonable number of localities: