rtree-geodetic 0.1.0__tar.gz
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.
- rtree_geodetic-0.1.0/.github/dependabot.yml +10 -0
- rtree_geodetic-0.1.0/.github/workflows/test.yml +164 -0
- rtree_geodetic-0.1.0/.github/workflows/wheels.yml +78 -0
- rtree_geodetic-0.1.0/.gitignore +16 -0
- rtree_geodetic-0.1.0/CHANGELOG.md +27 -0
- rtree_geodetic-0.1.0/Cargo.lock +1041 -0
- rtree_geodetic-0.1.0/Cargo.toml +84 -0
- rtree_geodetic-0.1.0/LICENSE-APACHE +201 -0
- rtree_geodetic-0.1.0/LICENSE-MIT +25 -0
- rtree_geodetic-0.1.0/PKG-INFO +179 -0
- rtree_geodetic-0.1.0/README.md +234 -0
- rtree_geodetic-0.1.0/benches/geodetic.rs +155 -0
- rtree_geodetic-0.1.0/benches/geodetic_extent.rs +263 -0
- rtree_geodetic-0.1.0/benches/geodetic_wgs84.rs +95 -0
- rtree_geodetic-0.1.0/cbindgen.toml +43 -0
- rtree_geodetic-0.1.0/examples/c/smoke.c +72 -0
- rtree_geodetic-0.1.0/include/rstar_geodetic.h +336 -0
- rtree_geodetic-0.1.0/justfile +21 -0
- rtree_geodetic-0.1.0/pyproject.toml +94 -0
- rtree_geodetic-0.1.0/python/Cargo.toml +25 -0
- rtree_geodetic-0.1.0/python/README.md +147 -0
- rtree_geodetic-0.1.0/python/benchmarks/bench.py +224 -0
- rtree_geodetic-0.1.0/python/rtree_geodetic/__init__.py +28 -0
- rtree_geodetic-0.1.0/python/rtree_geodetic/_rtree_geodetic.pyi +82 -0
- rtree_geodetic-0.1.0/python/rtree_geodetic/py.typed +0 -0
- rtree_geodetic-0.1.0/python/src/error.rs +20 -0
- rtree_geodetic-0.1.0/python/src/geo_interface.rs +212 -0
- rtree_geodetic-0.1.0/python/src/geometry.rs +121 -0
- rtree_geodetic-0.1.0/python/src/lib.rs +30 -0
- rtree_geodetic-0.1.0/python/src/tree.rs +467 -0
- rtree_geodetic-0.1.0/python/tests/test_geo_interface.py +117 -0
- rtree_geodetic-0.1.0/python/tests/test_geopandas.py +37 -0
- rtree_geodetic-0.1.0/python/tests/test_shapely.py +49 -0
- rtree_geodetic-0.1.0/python/tests/test_trees.py +167 -0
- rtree_geodetic-0.1.0/python/uv.lock +884 -0
- rtree_geodetic-0.1.0/src/ffi/construct.rs +682 -0
- rtree_geodetic-0.1.0/src/ffi/error.rs +136 -0
- rtree_geodetic-0.1.0/src/ffi/mod.rs +99 -0
- rtree_geodetic-0.1.0/src/ffi/query.rs +813 -0
- rtree_geodetic-0.1.0/src/geodetic/arc.rs +424 -0
- rtree_geodetic-0.1.0/src/geodetic/coord.rs +424 -0
- rtree_geodetic-0.1.0/src/geodetic/distance.rs +257 -0
- rtree_geodetic-0.1.0/src/geodetic/embedding.rs +534 -0
- rtree_geodetic-0.1.0/src/geodetic/geo_types_compat.rs +296 -0
- rtree_geodetic-0.1.0/src/geodetic/linestring.rs +256 -0
- rtree_geodetic-0.1.0/src/geodetic/mod.rs +29 -0
- rtree_geodetic-0.1.0/src/geodetic/point.rs +267 -0
- rtree_geodetic-0.1.0/src/geodetic/polygon.rs +518 -0
- rtree_geodetic-0.1.0/src/geodetic/spheroid.rs +419 -0
- rtree_geodetic-0.1.0/src/geodetic/tree.rs +988 -0
- rtree_geodetic-0.1.0/src/lib.rs +102 -0
- rtree_geodetic-0.1.0/tests/geodetic_arc_property.rs +261 -0
- rtree_geodetic-0.1.0/tests/geodetic_common/mod.rs +349 -0
- rtree_geodetic-0.1.0/tests/geodetic_embedding_property.rs +87 -0
- rtree_geodetic-0.1.0/tests/geodetic_extent_property.rs +574 -0
- rtree_geodetic-0.1.0/tests/geodetic_rtree.rs +557 -0
- rtree_geodetic-0.1.0/tests/geodetic_tree_property.rs +344 -0
- rtree_geodetic-0.1.0/tests/geodetic_wgs84_stress.rs +110 -0
- rtree_geodetic-0.1.0/tests/reference/arc_distance_reference.py +187 -0
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
name: Run tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
pull_request:
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
CARGO_TERM_COLOR: always
|
|
11
|
+
NO_STD_TARGET: aarch64-unknown-none
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
test:
|
|
15
|
+
name: Unit tests
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout repository
|
|
19
|
+
uses: actions/checkout@v7
|
|
20
|
+
- name: Install stable toolchain
|
|
21
|
+
uses: dtolnay/rust-toolchain@stable
|
|
22
|
+
- name: Setup Rust cache
|
|
23
|
+
uses: Swatinem/rust-cache@v2
|
|
24
|
+
with:
|
|
25
|
+
key: test
|
|
26
|
+
- name: Install nextest
|
|
27
|
+
uses: taiki-e/install-action@v2
|
|
28
|
+
with:
|
|
29
|
+
tool: cargo-nextest
|
|
30
|
+
- run: cargo nextest run
|
|
31
|
+
- run: cargo nextest run --features wgs84
|
|
32
|
+
# nextest does not run doctests.
|
|
33
|
+
- run: cargo test --doc
|
|
34
|
+
- run: cargo test --doc --features wgs84
|
|
35
|
+
# Guard that the optional `geo-types` feature is genuinely optional.
|
|
36
|
+
- run: cargo build --no-default-features
|
|
37
|
+
|
|
38
|
+
check:
|
|
39
|
+
name: Rustfmt and Clippy check
|
|
40
|
+
runs-on: ubuntu-latest
|
|
41
|
+
steps:
|
|
42
|
+
- name: Checkout repository
|
|
43
|
+
uses: actions/checkout@v7
|
|
44
|
+
- name: Install stable toolchain
|
|
45
|
+
uses: dtolnay/rust-toolchain@stable
|
|
46
|
+
with:
|
|
47
|
+
components: clippy, rustfmt
|
|
48
|
+
- name: Setup Rust cache
|
|
49
|
+
uses: Swatinem/rust-cache@v2
|
|
50
|
+
- name: Check formatting using Rustfmt
|
|
51
|
+
run: cargo fmt --all --check
|
|
52
|
+
- name: Lint using Clippy
|
|
53
|
+
run: cargo clippy --all-targets -- -D warnings
|
|
54
|
+
- name: Lint wgs84 feature using Clippy
|
|
55
|
+
run: cargo clippy --features wgs84 --all-targets -- -D warnings
|
|
56
|
+
|
|
57
|
+
msrv:
|
|
58
|
+
name: MSRV build
|
|
59
|
+
runs-on: ubuntu-latest
|
|
60
|
+
steps:
|
|
61
|
+
- name: Checkout repository
|
|
62
|
+
uses: actions/checkout@v7
|
|
63
|
+
- name: Install MSRV toolchain
|
|
64
|
+
uses: dtolnay/rust-toolchain@1.85.0
|
|
65
|
+
- name: Setup Rust cache
|
|
66
|
+
uses: Swatinem/rust-cache@v2
|
|
67
|
+
- name: Run cargo build for MSRV
|
|
68
|
+
run: cargo build --features wgs84
|
|
69
|
+
|
|
70
|
+
no_std:
|
|
71
|
+
name: no_std build
|
|
72
|
+
runs-on: ubuntu-latest
|
|
73
|
+
steps:
|
|
74
|
+
- name: Checkout repository
|
|
75
|
+
uses: actions/checkout@v7
|
|
76
|
+
- name: Install stable toolchain
|
|
77
|
+
uses: dtolnay/rust-toolchain@stable
|
|
78
|
+
with:
|
|
79
|
+
targets: ${{env.NO_STD_TARGET}}
|
|
80
|
+
- name: Setup Rust cache
|
|
81
|
+
uses: Swatinem/rust-cache@v2
|
|
82
|
+
with:
|
|
83
|
+
key: no-std-${{env.NO_STD_TARGET}}
|
|
84
|
+
- name: Run cargo build for ${{env.NO_STD_TARGET}}
|
|
85
|
+
run: cargo build --target ${{env.NO_STD_TARGET}}
|
|
86
|
+
|
|
87
|
+
ffi:
|
|
88
|
+
name: C API (ffi)
|
|
89
|
+
runs-on: ubuntu-latest
|
|
90
|
+
steps:
|
|
91
|
+
- name: Checkout repository
|
|
92
|
+
uses: actions/checkout@v7
|
|
93
|
+
- name: Install stable toolchain
|
|
94
|
+
uses: dtolnay/rust-toolchain@stable
|
|
95
|
+
with:
|
|
96
|
+
components: clippy
|
|
97
|
+
- name: Setup Rust cache
|
|
98
|
+
uses: Swatinem/rust-cache@v2
|
|
99
|
+
with:
|
|
100
|
+
key: ffi
|
|
101
|
+
- name: Install cbindgen and nextest
|
|
102
|
+
uses: taiki-e/install-action@v2
|
|
103
|
+
with:
|
|
104
|
+
tool: cbindgen,cargo-nextest
|
|
105
|
+
# In-crate tests only (`--lib` covers the ffi module); the integration and
|
|
106
|
+
# property suites already run in the test job.
|
|
107
|
+
- name: Test the ffi and wgs84 features
|
|
108
|
+
run: cargo nextest run --features ffi,wgs84 --lib
|
|
109
|
+
- name: Lint the ffi and wgs84 features using Clippy
|
|
110
|
+
run: cargo clippy --features ffi,wgs84 --all-targets -- -D warnings
|
|
111
|
+
- name: Check the committed C header is up to date
|
|
112
|
+
run: |
|
|
113
|
+
mkdir -p target
|
|
114
|
+
cbindgen --config cbindgen.toml --output target/rstar_geodetic.generated.h .
|
|
115
|
+
diff -u include/rstar_geodetic.h target/rstar_geodetic.generated.h
|
|
116
|
+
- name: Build the C library and run the smoke test
|
|
117
|
+
run: |
|
|
118
|
+
cargo rustc -p rstar_geodetic --release --features ffi,wgs84 --crate-type cdylib
|
|
119
|
+
cc examples/c/smoke.c -I include -DRSG_HAVE_WGS84 -L target/release -lrstar_geodetic -o target/rsg_smoke
|
|
120
|
+
LD_LIBRARY_PATH=target/release target/rsg_smoke
|
|
121
|
+
|
|
122
|
+
python:
|
|
123
|
+
name: Python bindings
|
|
124
|
+
runs-on: ubuntu-latest
|
|
125
|
+
steps:
|
|
126
|
+
- name: Checkout repository
|
|
127
|
+
uses: actions/checkout@v7
|
|
128
|
+
- name: Install stable toolchain
|
|
129
|
+
uses: dtolnay/rust-toolchain@stable
|
|
130
|
+
- name: Setup Rust cache
|
|
131
|
+
uses: Swatinem/rust-cache@v2
|
|
132
|
+
with:
|
|
133
|
+
key: python
|
|
134
|
+
- name: Install uv
|
|
135
|
+
uses: astral-sh/setup-uv@v8.3.2
|
|
136
|
+
with:
|
|
137
|
+
enable-cache: true
|
|
138
|
+
- name: Sync the environment
|
|
139
|
+
working-directory: python
|
|
140
|
+
run: uv sync
|
|
141
|
+
- name: Build the extension
|
|
142
|
+
working-directory: python
|
|
143
|
+
run: uv run maturin develop --uv
|
|
144
|
+
- name: Check formatting and lint with Ruff
|
|
145
|
+
working-directory: python
|
|
146
|
+
run: |
|
|
147
|
+
uv run ruff format --check .
|
|
148
|
+
uv run ruff check .
|
|
149
|
+
- name: Run pytest
|
|
150
|
+
working-directory: python
|
|
151
|
+
run: uv run pytest
|
|
152
|
+
|
|
153
|
+
conclusion:
|
|
154
|
+
needs:
|
|
155
|
+
- test
|
|
156
|
+
- check
|
|
157
|
+
- msrv
|
|
158
|
+
- no_std
|
|
159
|
+
- ffi
|
|
160
|
+
- python
|
|
161
|
+
runs-on: ubuntu-latest
|
|
162
|
+
steps:
|
|
163
|
+
- name: Result
|
|
164
|
+
run: echo "All checks passed"
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
name: Build Python wheels
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
# Python release tags only (for example py-v0.1.0), so Rust crate release
|
|
7
|
+
# tags never trigger a PyPI publish.
|
|
8
|
+
- "py-v*"
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
wheels:
|
|
16
|
+
name: Wheels on ${{ matrix.os }}
|
|
17
|
+
runs-on: ${{ matrix.os }}
|
|
18
|
+
strategy:
|
|
19
|
+
fail-fast: false
|
|
20
|
+
matrix:
|
|
21
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
22
|
+
steps:
|
|
23
|
+
- name: Checkout repository
|
|
24
|
+
uses: actions/checkout@v7
|
|
25
|
+
- name: Build wheels
|
|
26
|
+
uses: PyO3/maturin-action@v1
|
|
27
|
+
with:
|
|
28
|
+
working-directory: python
|
|
29
|
+
command: build
|
|
30
|
+
args: --release --out dist
|
|
31
|
+
sccache: "true"
|
|
32
|
+
manylinux: auto
|
|
33
|
+
- name: Upload wheels
|
|
34
|
+
uses: actions/upload-artifact@v7
|
|
35
|
+
with:
|
|
36
|
+
name: wheels-${{ matrix.os }}
|
|
37
|
+
path: python/dist/*.whl
|
|
38
|
+
|
|
39
|
+
sdist:
|
|
40
|
+
name: Source distribution
|
|
41
|
+
runs-on: ubuntu-latest
|
|
42
|
+
steps:
|
|
43
|
+
- name: Checkout repository
|
|
44
|
+
uses: actions/checkout@v7
|
|
45
|
+
- name: Build sdist
|
|
46
|
+
uses: PyO3/maturin-action@v1
|
|
47
|
+
with:
|
|
48
|
+
working-directory: python
|
|
49
|
+
command: sdist
|
|
50
|
+
args: --out dist
|
|
51
|
+
- name: Upload sdist
|
|
52
|
+
uses: actions/upload-artifact@v7
|
|
53
|
+
with:
|
|
54
|
+
name: sdist
|
|
55
|
+
path: python/dist/*.tar.gz
|
|
56
|
+
|
|
57
|
+
publish:
|
|
58
|
+
name: Publish to PyPI
|
|
59
|
+
# Publish only on tag pushes, not manual wheel-build runs.
|
|
60
|
+
if: startsWith(github.ref, 'refs/tags/py-v')
|
|
61
|
+
needs:
|
|
62
|
+
- wheels
|
|
63
|
+
- sdist
|
|
64
|
+
runs-on: ubuntu-latest
|
|
65
|
+
environment: pypi
|
|
66
|
+
permissions:
|
|
67
|
+
# Required for PyPI trusted publishing (OIDC).
|
|
68
|
+
id-token: write
|
|
69
|
+
steps:
|
|
70
|
+
- name: Download wheels and sdist
|
|
71
|
+
uses: actions/download-artifact@v7
|
|
72
|
+
with:
|
|
73
|
+
path: dist
|
|
74
|
+
merge-multiple: true
|
|
75
|
+
- name: Publish to PyPI
|
|
76
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
77
|
+
with:
|
|
78
|
+
packages-dir: dist
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/target
|
|
2
|
+
.DS_Store
|
|
3
|
+
# hegeltest working state; never commit it
|
|
4
|
+
.hegel/
|
|
5
|
+
|
|
6
|
+
# Python / maturin
|
|
7
|
+
.venv/
|
|
8
|
+
__pycache__/
|
|
9
|
+
*.py[cod]
|
|
10
|
+
.pytest_cache/
|
|
11
|
+
.ruff_cache/
|
|
12
|
+
/python/dist/
|
|
13
|
+
# The maturin-built extension module, dropped into the package by `maturin develop`.
|
|
14
|
+
/python/python/rstar_geodetic/*.so
|
|
15
|
+
/python/python/rstar_geodetic/*.pyd
|
|
16
|
+
/python/python/rstar_geodetic/*.dylib
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Initial release: a geodetic (longitude/latitude) R-tree built on `rstar`, using a
|
|
13
|
+
unit-sphere embedding and great-circle distance.
|
|
14
|
+
- `GeodeticRTree` with `GeodeticPoint`, `GeodeticLineString`, and `GeodeticPolygon`
|
|
15
|
+
leaves; nearest-neighbour, radius, and longitude/latitude window queries, including
|
|
16
|
+
across the antimeridian and the poles.
|
|
17
|
+
- Optional `wgs84` feature: ellipsoidal geodesic refine (Karney, via
|
|
18
|
+
`geographiclib-rs`) for the point tree, plus the standalone `geodesic_distance`.
|
|
19
|
+
- Default `geo-types` feature: `From`/`TryFrom` conversions between the geodetic
|
|
20
|
+
geometries and `geo-types` (pulled in with `default-features = false`, so the base
|
|
21
|
+
crate stays no_std). Inbound conversions validate; outbound are infallible. The
|
|
22
|
+
multi-geometries (`MultiPoint`, `MultiLineString`, `MultiPolygon`) convert via
|
|
23
|
+
`TryFrom` into a bulk-loaded `GeodeticRTree`.
|
|
24
|
+
- Property tests (Hegel) and an externally-anchored arc-distance reference.
|
|
25
|
+
|
|
26
|
+
This code was extracted from a feature branch of `rstar`. It uses only the public
|
|
27
|
+
`rstar` API.
|