Skip to content

Commit

Permalink
use readme for base level lib docs
Browse files Browse the repository at this point in the history
  • Loading branch information
JayKickliter committed Sep 24, 2024
1 parent f3ac308 commit b8661ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 45 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ with [H3 cell]s.

The primary structures are:

- **HexTreeMap**: an H3 cell-to-value map.
- **HexTreeSet**: an H3 cell set for hit-testing.
- [**HexTreeMap**]: an H3 cell-to-value map.
- [**HexTreeSet**]: an H3 cell set for hit-testing.

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

Expand Down Expand Up @@ -40,6 +40,8 @@ the same as its corresponding H3 cell resolution.
[serde]: https://docs.rs/serde/latest/serde
[compaction]: crate::compaction
[us915]: https://www.google.com/maps/d/u/0/edit?mid=15wRzxmtmyzqf6fHU3yuW4hJAM9MoxLJs
[**HexTreeMap**]: crate::HexTreeMap
[**HexTreeSet**]: crate::HexTreeSet

## License

Expand Down
44 changes: 1 addition & 43 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,47 +1,5 @@
#![deny(unsafe_code, missing_docs, rustdoc::broken_intra_doc_links)]

//! hextree provides tree structures that represent geographic regions
//! with H3 cells.
//!
//! The primary structures are:
//! - [`HexTreeMap`]: an Cell-to-value map.
//! - [`HexTreeSet`]: a Cell set for hit-testing.
//!
//! You can think of `HexTreeMap` vs. `HexTreeSet` as [`HashMap`] vs. [`HashSet`].
//!
//! For the rest of the documentation, we will use hextree to refer to
//! the general data structure.
//!
//! ## How is this different from `HashMap<Cell, 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`][us915].
//!
//! 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].
//!
//! [`HashMap`]: https://doc.rust-lang.org/std/collections/struct.HashMap.html
//! [`HashSet`]: https://doc.rust-lang.org/std/collections/struct.HashSet.html
//! [H3 cell]: https://h3geo.org/docs/core-library/h3Indexing
//! [serde]: https://docs.rs/serde/latest/serde
//! [compaction]: crate::compaction
//! [us915]: https://www.google.com/maps/d/u/0/edit?mid=15wRzxmtmyzqf6fHU3yuW4hJAM9MoxLJs
#![cfg_attr(not(doctest), doc = include_str!("../README.md"))]

mod cell;
pub mod compaction;
Expand Down

0 comments on commit b8661ce

Please sign in to comment.