Skip to content

Commit c7bc4f9

Browse files
authored
Small doc edits (#95)
1 parent 87e1ec8 commit c7bc4f9

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ A Rust crate for packed, immutable, zero-copy spatial indexes.
2828
## Drawbacks
2929

3030
- Trees are _immutable_. After creating the index, items can no longer be added or removed.
31-
- Only two-dimensional data is supported. This can still be used with higher-dimensional input as long as it's fine to only index two of the dimensions.
32-
- Queries return positional indexes into the input set, so you must manage your own collections.
33-
- Only the set of coordinate types that exist in JavaScript are allowed, to maintain FFI compatibility with the reference JavaScript implementations. This does not and probably will not support other types like `u64`.
31+
- Only two-dimensional indexes is supported. This can still be used with higher-dimensional input data as long as it's fine to only index two of the dimensions.
32+
- Queries return insertion indexes into the input set, so you must manage your own collections.
33+
- Only the set of coordinate types that exist in JavaScript are allowed, to maintain FFI compatibility with the reference JavaScript implementations. Hence this does not support other types like `u64`.
3434

3535
## Alternatives
3636

@@ -60,7 +60,6 @@ Currently, this library is used under the hood in [`geoarrow-rs`](https://github
6060

6161
## Future work
6262

63-
- Nearest-neighbor queries on the R-tree. This is implemented in the original JS version but hasn't been ported yet.
6463
- Geographic queries. Currently all queries are planar.
6564

6665
## Benchmarks

src/kdtree/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
//! An immutable, ABI-stable K-D Tree.
22
//!
3-
//! ## Creation
3+
//! ### Creation
44
//!
55
//! Use [`KDTreeBuilder`] to construct an [`KDTree`], which allows you to make queries.
66
//!
7-
//! ## Search
7+
//! ### Search
88
//!
99
//! Use [`KDTreeIndex::range`] to search a KDTree given a bounding box query. Use
1010
//! [`KDTreeIndex::within`] to search a KDTree given a point and radius.
1111
//!
12-
//! ## Persisting
12+
//! ### Persisting
1313
//!
1414
//! You can use [`KDTree::into_inner`] to access the underlying `Vec<u8>` it contains.
1515
//!
16-
//! ## Recovering the index
16+
//! ### Recovering the index
1717
//!
1818
//! You can use [`KDTreeRef::try_new`] to construct a KDTree as a reference on an external byte
1919
//! slice. If you don't know the coordinate type used in the index, you can use
2020
//! [`CoordType::from_buffer`][crate::CoordType::from_buffer] to infer the coordinate type.
2121
//!
22-
//! ## Coordinate types
22+
//! ### Coordinate types
2323
//!
2424
//! Supported coordinate types implement [`IndexableNum`][crate::IndexableNum]. Note that float
2525
//! `NaN` is not supported and may panic.

src/rtree/mod.rs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,33 @@
11
//! An immutable, ABI-stable RTree.
22
//!
3-
//! ## Creation
3+
//! ### Creation
44
//!
55
//! Use [`RTreeBuilder`] to construct an [`RTree`], which allows you to make queries.
66
//!
7-
//! ## Search
7+
//! ### Search
88
//!
9-
//! Use [`RTreeIndex::search`] to search an RTree given a bounding box query.
9+
//! Use [`RTreeIndex::search`] to search an RTree given a bounding box query or
10+
//! [`RTreeIndex::neighbors`] to find the nearest neighbors from a point.
1011
//!
11-
//! ## Persisting
12+
//! ### Persisting
1213
//!
1314
//! You can use [`RTree::into_inner`] to access the underlying `Vec<u8>` it contains.
1415
//!
15-
//! ## Recovering the index
16+
//! ### Recovering the index
1617
//!
1718
//! You can use [`RTreeRef::try_new`] to construct an RTree as a reference on an external byte
1819
//! slice. If you don't know the coordinate type used in the index, you can use
1920
//! [`CoordType::from_buffer`][crate::CoordType::from_buffer] to infer the coordinate type.
2021
//!
21-
//! ## Coordinate types
22+
//! ### Coordinate types
2223
//!
2324
//! Supported coordinate types implement [`IndexableNum`][crate::IndexableNum]. Note that float
2425
//! `NaN` is not supported and may panic.
2526
//!
27+
//! ### Alternate sorting methods
28+
//!
29+
//! This crate allows for multiple sorting methods, implemented in [`sort`].
30+
//!
2631
//! ## Example
2732
//!
2833
//! ```
@@ -48,10 +53,6 @@
4853
//! // Perform search again
4954
//! assert_eq!(tree_ref.search(0.5, 0.5, 1.5, 1.5), vec![0, 1]);
5055
//! ```
51-
//!
52-
//! ## Alternate sorting methods
53-
//!
54-
//! This crate allows for multiple sorting methods, implemented in [`sort`].
5556
5657
mod builder;
5758
mod constants;

0 commit comments

Comments
 (0)