MCPcopy Index your code
hub / github.com/JayKickliter/HexTree

github.com/JayKickliter/HexTree @v0.3.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.3.3 ↗ · + Follow
166 symbols 436 edges 20 files 45 documented · 27%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

CI Documentation

HexTree

hextree provides tree structures that represent geographic regions with H3 cells.

The primary structures are:

You can think of HexTreeMap vs. HexTreeSet as [HashMap] vs. [HashSet].

How is this different from HashMap<H3Cell, V>?

The key feature of a hextree is that its keys (H3 cells) are hierarchical. For instance, if you previously inserted an entry for a low-res cell, but later query for a higher-res child cell, the tree returns the value for the lower res cell. Additionally, with compaction, trees can automatically coalesce adjacent high-res cells into their parent cell. For very large regions, the compaction process can continue to lowest resolution cells (res-0), possibly removing millions of redundant cells from the tree. For example, a set of 4,795,661 res-7 cells representing North America coalesces into a 42,383 element HexTreeSet.

A hextree's internal structure exactly matches the semantics of an H3 cell. The root of the tree has 122 resolution-0 nodes, followed by 15 levels of 7-ary nodes. The level of an occupied node, or leaf node, is the same as its corresponding H3 cell resolution.

Features

  • serde: support for serialization via serde.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Extension points exported contracts — how you extend this code

Compactor (Interface)
A user provided compactor. The compactor trait allows you customize compaction behavior after calling `insert` on a tre [3 …
src/compaction.rs
DtSeek (Interface)
(no doc) [3 implementers]
src/disktree/dtseek.rs

Core symbols most depended-on inside this repo

iter
called by 62
src/hex_tree_map.rs
push
called by 20
src/cell.rs
iter
called by 16
src/disktree/tree.rs
to_parent
called by 15
src/cell.rs
insert
called by 13
src/node.rs
res
called by 13
src/cell.rs
descendants
called by 10
src/hex_tree_map.rs
base
called by 10
src/cell.rs

Shape

Method 103
Function 39
Class 14
Enum 8
Interface 2

Languages

Rust100%

Modules by API surface

src/hex_tree_map.rs27 symbols
src/cell.rs26 symbols
src/disktree/iter.rs14 symbols
src/disktree/tree.rs11 symbols
src/iteration.rs10 symbols
src/node.rs9 symbols
src/disktree/dptr.rs9 symbols
benches/benches.rs9 symbols
src/disktree/writer.rs8 symbols
src/entry.rs7 symbols
src/disktree/mod.rs7 symbols
tests/tests.rs6 symbols

For agents

$ claude mcp add HexTree \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact