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

CARTO: Improve H3Tileset2D.getTileIndices() by adding buffer #8781

Merged
merged 16 commits into from
Apr 12, 2024

Conversation

felixpalmer
Copy link
Collaborator

@felixpalmer felixpalmer commented Apr 11, 2024

Background

Due to h3.polygonToCells polyfilling base on cell centers, H3Tileset2D.getTileIndices() sometimes misses cells near the edges of the viewport. Previously the code would sample at a higher h3 level, but even this would sometimes miss cells.

Without padding:
Screenshot 2024-04-11 at 10 56 08

With padding:

Screenshot 2024-04-11 at 10 57 17

Change List

  • Add padBoundingBox function to increase bounds by size of cell
  • Reduce oversampling
  • Fix east/west mixup
  • Test update

@coveralls
Copy link

coveralls commented Apr 11, 2024

Coverage Status

coverage: 90.002% (+0.006%) from 89.996%
when pulling 9bbd05c on felix/h3-buffer
into 5ad2534 on master.

Copy link
Collaborator

@donmccurdy donmccurdy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvement!

@felixpalmer felixpalmer merged commit 553ddff into master Apr 12, 2024
4 checks passed
@felixpalmer felixpalmer deleted the felix/h3-buffer branch April 12, 2024 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants