Repository navigation
Update average edge lengths - #749
Merged
Merged
Conversation
Also added a sentence on methodology
nrabinowitz
approved these changes
Jan 31, 2023
Contributor
|
This looks great, thanks for the contribution! I'll let @ajfriend check the approach here, but it LGTM. I believe you're correct that all we would need to do in code is modify the hard-coded values, feel free to add that to this PR. |
Contributor
Author
|
Sounds good, I went ahead and updated the hard-coded average edge length values in my latest commit. I rounded all values to 10 significant digits, as the original code does. |
dfellis
approved these changes
Feb 6, 2023
Contributor
ajfriend
approved these changes
Mar 23, 2023
grim7reaper
added a commit
to HydroniumLabs/h3o
that referenced
this pull request
Jul 30, 2023
H3 reference implementation did the same in uber/h3#749 Couldn't test against it since it's not released yet (and thus there is no h3ron_h3_sys that binds to it). Not a big deal since I shouldn't exclusively rely on tests against H3 to ensure my correctness. Instead I have a little tool (which is equivalent to the Python notebook linked in the PR) that generated a golden file and I test against it.
zachasme
added a commit
to postgis/h3-pg
that referenced
this pull request
Jan 2, 2025
The constant changes in tests are related to uber/h3#749
alexey-milovidov
added a commit
to ClickHouse/ClickHouse
that referenced
this pull request
Mar 22, 2026
The H3 C library fork (github.com/ClickHouse/h3) was on v3.7.1 with 2 ClickHouse-specific range-check patches. Upstream H3 v4 already includes equivalent validation in `_h3ToFaceIjk`, so the patches are no longer needed. Created a clean `clickhouse-v4` branch in the fork at upstream tag v4.4.1 with no additional patches. This fixes two known bugs in the v3 lookup tables: - Average hexagon edge lengths were actually inradii (apothems), not edge lengths (uber/h3#201, fixed in uber/h3#749) - Average hexagon areas naively divided Earth surface by total cell count without excluding pentagon areas (fixed in uber/h3#529) The v4 API changed most functions to return `H3Error` with results via output parameters. Updated all 27 wrapper files in `src/Functions/` to use the new calling convention. Also updated function renames: `exactEdgeLengthM` → `edgeLengthM`, `distanceM` → `greatCircleDistanceM`, etc. Updated 11 test reference files to reflect the corrected values. Reference: #100272 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
dvanduzer
added a commit
to tennica/hexmosphere
that referenced
this pull request
Oct 22, 2026
H3 C 4.1.0 still had the old average edge-length table, about 13% smaller; H3 replaced it in March 2023 (uber/h3#749). With v4.5.0 the two backends match on edge lengths at every resolution (within a millionth of a metre) as well as on cells and outlines (100,000 random points at resolutions 7, 9 and 11). The README and the switch's help now say they agree, and note the earlier mistake. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01MHdRua2oBLtZHVW7Q9BrjH
This was referenced Nov 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

I recomputed average edge lengths for all H3 resolutions, building off of the proposed methodology and example notebook provided by @ajfriend in #666 (which involves calculating exact averages for resolutions 0 through 6 and then extrapolating the rest). This would help fix #526 and other issues related to average edge lengths.
Source notebook: https://gist.github.com/mciethan/3e10802c1f41972831c325994d97ef27
My initial commit to this PR only modifies the restable docs. I haven't attempted to modify the average edge length function itself, although it would make sense to do that before updating the docs. I assume that would just be a matter of updating the hard-coded values, but I am a novice of H3 and also don't know any C programming, so I don't have a good understanding of exactly which files would need to be updated, how to test the changes, etc.