uber / uber/h3

Max edge length in meters

Open
#608 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
6.5k
Forks
627
Avg merge
3d 21h
Merged PRs (30d)
6

Description

I'm considering using H3 polyfill to find some data within a region (Polygon). However, it's necessary to include all of the data, not just H3 indexes with centroids in the region.
First and foremost, is there a recommended way of doing this?
My plan is to buffer the region by the maximum edge length (in meters/km) at the H3 resolution used in my dataset to ensure all cells that could include data within that region are included. To accomplish this, I would need to know the maximum edge length at the resolution. It would be best to have a function that computes this at a given resolution, like this in S2. It would also be useful to publish this along with the other cell statistics.
So far I've taken a Monte Carlo 🎲 approach (generating indexes random latitude and longitude and finding the maximum distance between the index and its neighbors, then finding the maximum of that over millions of random points) and it seems the max length is stable around 31.596 meters for resolution 11, and 83.595 for resolution 10. I'm enjoying the fact that 83.595 / 31.596 is almost identical to the square root of 7.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue mentions H3 polyfill, resolution-based edge lengths, and existing cell statistics, but no repository files or tests. Start by locating the polyfill implementation and the entry points that expose cell statistics, then compare the requested metric with the linked S2 LengthMetric reference. Done means the inclusion requirement and the way maximum edge length is computed and exposed are clearly defined.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.