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

use readme for base level lib docs #46

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading