rstar-python 0.0.2__cp39-cp39-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
rstar_python/__init__.py
ADDED
|
Binary file
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: rstar-python
|
|
3
|
+
Version: 0.0.2
|
|
4
|
+
Classifier: Development Status :: 3 - Alpha
|
|
5
|
+
Classifier: Intended Audience :: Developers
|
|
6
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
11
|
+
Classifier: Programming Language :: Rust
|
|
12
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
13
|
+
Classifier: Operating System :: MacOS
|
|
14
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
15
|
+
Requires-Dist: numpy>=1.21.6
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
Summary: Python bindings for the rstar R*-tree spatial index
|
|
18
|
+
Home-Page: https://github.com/kephale/rstar-python
|
|
19
|
+
Author-email: Kyle Harrington <kyle@kyleharrington.com>
|
|
20
|
+
License: MIT
|
|
21
|
+
Requires-Python: >=3.10
|
|
22
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
23
|
+
Project-URL: Homepage, https://github.com/kephale/rstar-python
|
|
24
|
+
Project-URL: Repository, https://github.com/kephale/rstar-python
|
|
25
|
+
Project-URL: Issues, https://github.com/kephale/rstar-python/issues
|
|
26
|
+
|
|
27
|
+
# rstar-python
|
|
28
|
+
|
|
29
|
+
Python bindings for the [rstar](https://github.com/georust/rstar) R*-tree spatial index library.
|
|
30
|
+
|
|
31
|
+
## Installation
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pip install rstar-python
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Usage
|
|
38
|
+
|
|
39
|
+
```python
|
|
40
|
+
from rstar_python import PyRTree
|
|
41
|
+
|
|
42
|
+
# Create a 3D R-tree
|
|
43
|
+
tree = PyRTree(dims=3)
|
|
44
|
+
|
|
45
|
+
# Insert points
|
|
46
|
+
tree.insert([1.0, 2.0, 3.0])
|
|
47
|
+
tree.insert([4.0, 5.0, 6.0])
|
|
48
|
+
|
|
49
|
+
# Bulk load points
|
|
50
|
+
points = [
|
|
51
|
+
[1.0, 2.0, 3.0],
|
|
52
|
+
[4.0, 5.0, 6.0],
|
|
53
|
+
[7.0, 8.0, 9.0]
|
|
54
|
+
]
|
|
55
|
+
tree.bulk_load(points)
|
|
56
|
+
|
|
57
|
+
# Find nearest neighbor
|
|
58
|
+
nearest = tree.nearest_neighbor([1.1, 2.1, 3.1])
|
|
59
|
+
|
|
60
|
+
# Find k nearest neighbors
|
|
61
|
+
k_nearest = tree.k_nearest_neighbors([1.1, 2.1, 3.1], k=2)
|
|
62
|
+
|
|
63
|
+
# Find neighbors within radius
|
|
64
|
+
neighbors = tree.neighbors_within_radius([1.0, 2.0, 3.0], radius=1.0)
|
|
65
|
+
|
|
66
|
+
# Query points within a bounding box
|
|
67
|
+
points = tree.locate_in_envelope(
|
|
68
|
+
min_corner=[0.0, 0.0, 0.0],
|
|
69
|
+
max_corner=[2.0, 2.0, 2.0]
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
# Get tree size
|
|
73
|
+
size = tree.size()
|
|
74
|
+
|
|
75
|
+
# Remove a point
|
|
76
|
+
tree.remove([1.0, 2.0, 3.0])
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Features
|
|
80
|
+
|
|
81
|
+
- Supports 1D to 4D points
|
|
82
|
+
- Fast nearest neighbor queries
|
|
83
|
+
- Radius search
|
|
84
|
+
- Bounding box queries
|
|
85
|
+
- Bulk loading for faster initialization
|
|
86
|
+
- Built on top of the fast Rust rstar library
|
|
87
|
+
|
|
88
|
+
## Development
|
|
89
|
+
|
|
90
|
+
Requirements:
|
|
91
|
+
- Rust
|
|
92
|
+
- Python 3.7+
|
|
93
|
+
- maturin
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
# Clone repository
|
|
97
|
+
git clone https://github.com/kephale/rstar-python
|
|
98
|
+
cd rstar-python
|
|
99
|
+
|
|
100
|
+
# Create virtual environment
|
|
101
|
+
python -m venv venv
|
|
102
|
+
source venv/bin/activate # or `venv\Scripts\activate` on Windows
|
|
103
|
+
|
|
104
|
+
# Install development dependencies
|
|
105
|
+
pip install maturin pytest
|
|
106
|
+
|
|
107
|
+
# Build and install in development mode
|
|
108
|
+
maturin develop
|
|
109
|
+
|
|
110
|
+
# Run tests
|
|
111
|
+
pytest
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## License
|
|
115
|
+
|
|
116
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
rstar_python-0.0.2.dist-info/METADATA,sha256=u0VPctP3B5y1-3r-g8WqF5RYbNIGscptbwtu2wYhUvk,2854
|
|
2
|
+
rstar_python-0.0.2.dist-info/WHEEL,sha256=nXnbksKtHhahczd7ttWN6X6HjQgLPILVWf_tYUzg9Pc,94
|
|
3
|
+
rstar_python-0.0.2.dist-info/licenses/LICENSE,sha256=1vNK5wtdii97XWiIu-tGrewxnElyhROT7asu56sopuQ,1097
|
|
4
|
+
rstar_python/__init__.py,sha256=0MwoQYtUD1d4BA0J-n31O_tQpso4nN2ttWSt5pWsLek,131
|
|
5
|
+
rstar_python/rstar_python.cp39-win_amd64.pyd,sha256=2BkCdxbaCULQRZ6J7ViiyGC7KASQkbGN4VL4w2yY4Hc,619008
|
|
6
|
+
rstar_python-0.0.2.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Kyle I S Harrington
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|