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

Tile hashing fix #436

Merged
merged 6 commits into from
Jan 14, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixed typo from previous clean-up: containsOnlyFillsOrEdges() is the …
…right one for this
  • Loading branch information
phanecak-maptiler committed Jan 11, 2023
commit 6e40ec27b611f51acb4c95405f865e847c3ba9ef
Original file line number Diff line number Diff line change
Expand Up @@ -532,13 +532,13 @@ private boolean containsOnlyFillsOrEdges(boolean allowEdges) {
* generating mbtiles which are too big. This method is responsible for achieving that balance.
* <p>
* Current understanding is, that for the whole planet, there are 267m total tiles and 38m unique tiles. The
* {@link #containsOnlyFills()} heuristic catches >99.9% of repeated tiles and cuts down the number of tile hashes we
* need to track by 98% (38m to 735k). So it is considered a good tradeoff.
* {@link #containsOnlyFillsOrEdges()} heuristic catches >99.9% of repeated tiles and cuts down the number of tile
* hashes we need to track by 98% (38m to 735k). So it is considered a good tradeoff.
*
* @return {@code true} if the tile might have duplicates hence we want to calculate a hash for it
*/
public boolean likelyToBeDuplicated() {
return layers.values().stream().allMatch(v -> v.encodedFeatures.isEmpty()) || containsOnlyFills();
return layers.values().stream().allMatch(v -> v.encodedFeatures.isEmpty()) || containsOnlyFillsOrEdges();
}

private enum Command {
Expand Down