rust-geo-python 0.1.6__tar.gz → 0.1.8__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.
Files changed (28) hide show
  1. {rust_geo_python-0.1.6 → rust_geo_python-0.1.8}/.github/workflows/CI.yml +49 -31
  2. rust_geo_python-0.1.8/.gitignore +13 -0
  3. {rust_geo_python-0.1.6 → rust_geo_python-0.1.8}/Cargo.lock +63 -29
  4. {rust_geo_python-0.1.6 → rust_geo_python-0.1.8}/Cargo.toml +7 -4
  5. rust_geo_python-0.1.8/PKG-INFO +149 -0
  6. rust_geo_python-0.1.8/README.md +142 -0
  7. {rust_geo_python-0.1.6/src → rust_geo_python-0.1.8/src/core}/functions.rs +10 -8
  8. rust_geo_python-0.1.8/src/core/mod.rs +2 -0
  9. rust_geo_python-0.1.8/src/core/tiling.rs +169 -0
  10. rust_geo_python-0.1.8/src/error.rs +23 -0
  11. rust_geo_python-0.1.8/src/lib.rs +24 -0
  12. rust_geo_python-0.1.8/src/macros.rs +342 -0
  13. rust_geo_python-0.1.8/src/py/enums.rs +1155 -0
  14. rust_geo_python-0.1.8/src/py/mod.rs +2 -0
  15. {rust_geo_python-0.1.6/src → rust_geo_python-0.1.8/src/py}/pyfunctions.rs +55 -22
  16. rust_geo_python-0.1.8/tests/test_geometry_creation.py +53 -0
  17. rust_geo_python-0.1.8/tests/test_measurements.py +47 -0
  18. rust_geo_python-0.1.8/tests/test_predicates.py +51 -0
  19. rust_geo_python-0.1.8/tests/test_set_operations.py +52 -0
  20. rust_geo_python-0.1.8/tests/test_stand-alone_functions.py +45 -0
  21. rust_geo_python-0.1.8/tests/test_wkt_and_collections.py +45 -0
  22. rust_geo_python-0.1.6/.gitignore +0 -6
  23. rust_geo_python-0.1.6/PKG-INFO +0 -8
  24. rust_geo_python-0.1.6/README.md +0 -1
  25. rust_geo_python-0.1.6/src/enums.rs +0 -1093
  26. rust_geo_python-0.1.6/src/lib.rs +0 -20
  27. {rust_geo_python-0.1.6 → rust_geo_python-0.1.8}/LICENSE.txt +0 -0
  28. {rust_geo_python-0.1.6 → rust_geo_python-0.1.8}/pyproject.toml +0 -0
@@ -1,7 +1,7 @@
1
- # This file is autogenerated by maturin v1.9.4
1
+ # This file is autogenerated by maturin v1.11.5
2
2
  # To update, run
3
3
  #
4
- # maturin generate-ci github
4
+ # maturin generate-ci github --manifest-path Cargo.toml --platform all
5
5
  #
6
6
  name: CI
7
7
 
@@ -36,8 +36,8 @@ jobs:
36
36
  - runner: ubuntu-22.04
37
37
  target: ppc64le
38
38
  steps:
39
- - uses: actions/checkout@v4
40
- - uses: actions/setup-python@v5
39
+ - uses: actions/checkout@v6
40
+ - uses: actions/setup-python@v6
41
41
  with:
42
42
  python-version: 3.x
43
43
  - name: Build wheels
@@ -55,7 +55,7 @@ jobs:
55
55
  sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
56
56
  manylinux: auto
57
57
  - name: Upload wheels
58
- uses: actions/upload-artifact@v4
58
+ uses: actions/upload-artifact@v5
59
59
  with:
60
60
  name: wheels-linux-${{ matrix.platform.target }}
61
61
  path: dist
@@ -74,8 +74,8 @@ jobs:
74
74
  - runner: ubuntu-22.04
75
75
  target: armv7
76
76
  steps:
77
- - uses: actions/checkout@v4
78
- - uses: actions/setup-python@v5
77
+ - uses: actions/checkout@v6
78
+ - uses: actions/setup-python@v6
79
79
  with:
80
80
  python-version: 3.x
81
81
  - name: Build wheels
@@ -93,7 +93,7 @@ jobs:
93
93
  sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
94
94
  manylinux: musllinux_1_2
95
95
  - name: Upload wheels
96
- uses: actions/upload-artifact@v4
96
+ uses: actions/upload-artifact@v5
97
97
  with:
98
98
  name: wheels-musllinux-${{ matrix.platform.target }}
99
99
  path: dist
@@ -105,24 +105,29 @@ jobs:
105
105
  platform:
106
106
  - runner: windows-latest
107
107
  target: x64
108
+ python_arch: x64
108
109
  - runner: windows-latest
109
110
  target: x86
111
+ python_arch: x86
112
+ - runner: windows-latest
113
+ target: aarch64
114
+ python_arch: x64
110
115
  steps:
111
- - uses: actions/checkout@v4
112
- - uses: actions/setup-python@v5
116
+ - uses: actions/checkout@v6
117
+ - uses: actions/setup-python@v6
113
118
  with:
114
- python-version: 3.x
115
- architecture: ${{ matrix.platform.target }}
119
+ python-version: 3.13
120
+ architecture: ${{ matrix.platform.python_arch }}
116
121
  - name: Build wheels
117
122
  uses: PyO3/maturin-action@v1
118
123
  with:
119
124
  target: ${{ matrix.platform.target }}
120
125
  args: --release --out dist
121
126
  sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
122
- - uses: actions/setup-python@v5
127
+ - uses: actions/setup-python@v6
123
128
  with:
124
129
  python-version: 3.13t
125
- architecture: ${{ matrix.platform.target }}
130
+ architecture: ${{ matrix.platform.python_arch }}
126
131
  - name: Build free-threaded wheels
127
132
  uses: PyO3/maturin-action@v1
128
133
  with:
@@ -130,7 +135,7 @@ jobs:
130
135
  args: --release --out dist -i python3.13t
131
136
  sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
132
137
  - name: Upload wheels
133
- uses: actions/upload-artifact@v4
138
+ uses: actions/upload-artifact@v5
134
139
  with:
135
140
  name: wheels-windows-${{ matrix.platform.target }}
136
141
  path: dist
@@ -140,13 +145,13 @@ jobs:
140
145
  strategy:
141
146
  matrix:
142
147
  platform:
143
- - runner: macos-15
148
+ - runner: macos-15-intel
144
149
  target: x86_64
145
- - runner: macos-14
150
+ - runner: macos-latest
146
151
  target: aarch64
147
152
  steps:
148
- - uses: actions/checkout@v4
149
- - uses: actions/setup-python@v5
153
+ - uses: actions/checkout@v6
154
+ - uses: actions/setup-python@v6
150
155
  with:
151
156
  python-version: 3.x
152
157
  - name: Build wheels
@@ -162,7 +167,7 @@ jobs:
162
167
  args: --release --out dist -i python3.13t
163
168
  sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
164
169
  - name: Upload wheels
165
- uses: actions/upload-artifact@v4
170
+ uses: actions/upload-artifact@v5
166
171
  with:
167
172
  name: wheels-macos-${{ matrix.platform.target }}
168
173
  path: dist
@@ -170,14 +175,14 @@ jobs:
170
175
  sdist:
171
176
  runs-on: ubuntu-latest
172
177
  steps:
173
- - uses: actions/checkout@v4
178
+ - uses: actions/checkout@v6
174
179
  - name: Build sdist
175
180
  uses: PyO3/maturin-action@v1
176
181
  with:
177
182
  command: sdist
178
183
  args: --out dist
179
184
  - name: Upload sdist
180
- uses: actions/upload-artifact@v4
185
+ uses: actions/upload-artifact@v5
181
186
  with:
182
187
  name: wheels-sdist
183
188
  path: dist
@@ -185,20 +190,33 @@ jobs:
185
190
  release:
186
191
  name: Release
187
192
  runs-on: ubuntu-latest
188
- environment: release
189
- #if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
193
+ if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
190
194
  needs: [linux, musllinux, windows, macos, sdist]
195
+ environment:
196
+ # Create this environment in the GitHub repository under Settings -> Environments
197
+ name: release
191
198
  permissions:
192
199
  # Use to sign the release artifacts
193
200
  id-token: write
194
201
  # Used to upload release artifacts
195
202
  contents: write
203
+ # Used to generate artifact attestation
204
+ attestations: write
196
205
  steps:
197
- - uses: actions/download-artifact@v4
206
+ - uses: actions/download-artifact@v6
207
+ - name: Generate artifact attestation
208
+ uses: actions/attest-build-provenance@v3
209
+ with:
210
+ subject-path: 'wheels-*/*'
211
+ - name: Install uv
212
+ if: ${{ startsWith(github.ref, 'refs/tags/') }}
213
+ uses: astral-sh/setup-uv@v7
198
214
  - name: Publish to PyPI
199
- #if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
200
- uses: PyO3/maturin-action@v1
201
- with:
202
- command: upload
203
- args: --non-interactive --skip-existing wheels-*/*
204
-
215
+ if: ${{ startsWith(github.ref, 'refs/tags/') }}
216
+ run: uv publish 'wheels-*/*'
217
+ - name: Upload to GitHub Release
218
+ uses: softprops/action-gh-release@v1
219
+ with:
220
+ files: |
221
+ wasm-wheels/*.whl
222
+ prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}
@@ -0,0 +1,13 @@
1
+ *
2
+ !Cargo.toml
3
+ !tests
4
+ !tests/*
5
+ !src
6
+ !src/*
7
+ !src/core/*
8
+ !src/core/
9
+ !src/py/*
10
+ !src/py/
11
+ !pyproject.toml
12
+ !README.md
13
+ !LICENSE.txt
@@ -29,6 +29,16 @@ version = "1.5.0"
29
29
  source = "registry+https://github.com/rust-lang/crates.io-index"
30
30
  checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
31
31
 
32
+ [[package]]
33
+ name = "cc"
34
+ version = "1.2.55"
35
+ source = "registry+https://github.com/rust-lang/crates.io-index"
36
+ checksum = "47b26a0954ae34af09b50f0de26458fa95369a0d478d8236d3f93082b219bd29"
37
+ dependencies = [
38
+ "find-msvc-tools",
39
+ "shlex",
40
+ ]
41
+
32
42
  [[package]]
33
43
  name = "cfg-if"
34
44
  version = "1.0.4"
@@ -82,6 +92,12 @@ version = "1.0.2"
82
92
  source = "registry+https://github.com/rust-lang/crates.io-index"
83
93
  checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
84
94
 
95
+ [[package]]
96
+ name = "find-msvc-tools"
97
+ version = "0.1.9"
98
+ source = "registry+https://github.com/rust-lang/crates.io-index"
99
+ checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582"
100
+
85
101
  [[package]]
86
102
  name = "float_next_after"
87
103
  version = "1.0.0"
@@ -138,18 +154,18 @@ dependencies = [
138
154
 
139
155
  [[package]]
140
156
  name = "geographiclib-rs"
141
- version = "0.2.5"
157
+ version = "0.2.6"
142
158
  source = "registry+https://github.com/rust-lang/crates.io-index"
143
- checksum = "f611040a2bb37eaa29a78a128d1e92a378a03e0b6e66ae27398d42b1ba9a7841"
159
+ checksum = "bc8f647bd562db28a15e0dce4a77d89e3a78f6f85943e782418ebdbb420ea3c4"
144
160
  dependencies = [
145
161
  "libm",
146
162
  ]
147
163
 
148
164
  [[package]]
149
165
  name = "getrandom"
150
- version = "0.2.16"
166
+ version = "0.2.17"
151
167
  source = "registry+https://github.com/rust-lang/crates.io-index"
152
- checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592"
168
+ checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0"
153
169
  dependencies = [
154
170
  "cfg-if",
155
171
  "libc",
@@ -215,9 +231,9 @@ checksum = "9190f86706ca38ac8add223b2aed8b1330002b5cdbbce28fb58b10914d38fc27"
215
231
 
216
232
  [[package]]
217
233
  name = "i_overlay"
218
- version = "4.0.6"
234
+ version = "4.0.7"
219
235
  source = "registry+https://github.com/rust-lang/crates.io-index"
220
- checksum = "0fcccbd4e4274e0f80697f5fbc6540fdac533cce02f2081b328e68629cce24f9"
236
+ checksum = "413183068e6e0289e18d7d0a1f661b81546e6918d5453a44570b9ab30cbed1b3"
221
237
  dependencies = [
222
238
  "i_float",
223
239
  "i_key_sort",
@@ -271,15 +287,15 @@ dependencies = [
271
287
 
272
288
  [[package]]
273
289
  name = "libc"
274
- version = "0.2.180"
290
+ version = "0.2.181"
275
291
  source = "registry+https://github.com/rust-lang/crates.io-index"
276
- checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc"
292
+ checksum = "459427e2af2b9c839b132acb702a1c654d95e10f8c326bfc2ad11310e458b1c5"
277
293
 
278
294
  [[package]]
279
295
  name = "libm"
280
- version = "0.2.15"
296
+ version = "0.2.16"
281
297
  source = "registry+https://github.com/rust-lang/crates.io-index"
282
- checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de"
298
+ checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981"
283
299
 
284
300
  [[package]]
285
301
  name = "log"
@@ -299,9 +315,9 @@ dependencies = [
299
315
 
300
316
  [[package]]
301
317
  name = "memchr"
302
- version = "2.7.6"
318
+ version = "2.8.0"
303
319
  source = "registry+https://github.com/rust-lang/crates.io-index"
304
- checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273"
320
+ checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79"
305
321
 
306
322
  [[package]]
307
323
  name = "memoffset"
@@ -314,9 +330,9 @@ dependencies = [
314
330
 
315
331
  [[package]]
316
332
  name = "ndarray"
317
- version = "0.17.1"
333
+ version = "0.17.2"
318
334
  source = "registry+https://github.com/rust-lang/crates.io-index"
319
- checksum = "0c7c9125e8f6f10c9da3aad044cc918cf8784fa34de857b1aa68038eb05a50a9"
335
+ checksum = "520080814a7a6b4a6e9070823bb24b4531daac8c4627e08ba5de8c5ef2f2752d"
320
336
  dependencies = [
321
337
  "matrixmultiply",
322
338
  "num-complex",
@@ -402,15 +418,15 @@ checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
402
418
 
403
419
  [[package]]
404
420
  name = "portable-atomic"
405
- version = "1.13.0"
421
+ version = "1.13.1"
406
422
  source = "registry+https://github.com/rust-lang/crates.io-index"
407
- checksum = "f89776e4d69bb58bc6993e99ffa1d11f228b839984854c7daeb5d37f87cbe950"
423
+ checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49"
408
424
 
409
425
  [[package]]
410
426
  name = "portable-atomic-util"
411
- version = "0.2.4"
427
+ version = "0.2.5"
412
428
  source = "registry+https://github.com/rust-lang/crates.io-index"
413
- checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507"
429
+ checksum = "7a9db96d7fa8782dd8c15ce32ffe8680bbd1e978a43bf51a34d39483540495f5"
414
430
  dependencies = [
415
431
  "portable-atomic",
416
432
  ]
@@ -435,9 +451,9 @@ dependencies = [
435
451
 
436
452
  [[package]]
437
453
  name = "proc-macro2"
438
- version = "1.0.105"
454
+ version = "1.0.106"
439
455
  source = "registry+https://github.com/rust-lang/crates.io-index"
440
- checksum = "535d180e0ecab6268a3e718bb9fd44db66bbbc256257165fc699dadf70d16fe7"
456
+ checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
441
457
  dependencies = [
442
458
  "unicode-ident",
443
459
  ]
@@ -465,6 +481,7 @@ version = "0.27.2"
465
481
  source = "registry+https://github.com/rust-lang/crates.io-index"
466
482
  checksum = "b455933107de8642b4487ed26d912c2d899dec6114884214a0b3bb3be9261ea6"
467
483
  dependencies = [
484
+ "python3-dll-a",
468
485
  "target-lexicon",
469
486
  ]
470
487
 
@@ -503,11 +520,20 @@ dependencies = [
503
520
  "syn",
504
521
  ]
505
522
 
523
+ [[package]]
524
+ name = "python3-dll-a"
525
+ version = "0.2.14"
526
+ source = "registry+https://github.com/rust-lang/crates.io-index"
527
+ checksum = "d381ef313ae70b4da5f95f8a4de773c6aa5cd28f73adec4b4a31df70b66780d8"
528
+ dependencies = [
529
+ "cc",
530
+ ]
531
+
506
532
  [[package]]
507
533
  name = "quote"
508
- version = "1.0.43"
534
+ version = "1.0.44"
509
535
  source = "registry+https://github.com/rust-lang/crates.io-index"
510
- checksum = "dc74d9a594b72ae6656596548f56f667211f8a97b3d4c3d467150794690dc40a"
536
+ checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4"
511
537
  dependencies = [
512
538
  "proc-macro2",
513
539
  ]
@@ -587,10 +613,12 @@ dependencies = [
587
613
 
588
614
  [[package]]
589
615
  name = "rust-geo-python"
590
- version = "0.1.6"
616
+ version = "0.1.8"
591
617
  dependencies = [
592
618
  "geo",
619
+ "i_overlay",
593
620
  "ndarray",
621
+ "num-traits",
594
622
  "numpy",
595
623
  "pyo3",
596
624
  "wkb",
@@ -639,6 +667,12 @@ dependencies = [
639
667
  "syn",
640
668
  ]
641
669
 
670
+ [[package]]
671
+ name = "shlex"
672
+ version = "1.3.0"
673
+ source = "registry+https://github.com/rust-lang/crates.io-index"
674
+ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
675
+
642
676
  [[package]]
643
677
  name = "sif-itree"
644
678
  version = "0.4.0"
@@ -738,9 +772,9 @@ dependencies = [
738
772
 
739
773
  [[package]]
740
774
  name = "unicode-ident"
741
- version = "1.0.22"
775
+ version = "1.0.23"
742
776
  source = "registry+https://github.com/rust-lang/crates.io-index"
743
- checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5"
777
+ checksum = "537dd038a89878be9b64dd4bd1b260315c1bb94f4d784956b81e27a088d9a09e"
744
778
 
745
779
  [[package]]
746
780
  name = "unindent"
@@ -790,18 +824,18 @@ dependencies = [
790
824
 
791
825
  [[package]]
792
826
  name = "zerocopy"
793
- version = "0.8.33"
827
+ version = "0.8.39"
794
828
  source = "registry+https://github.com/rust-lang/crates.io-index"
795
- checksum = "668f5168d10b9ee831de31933dc111a459c97ec93225beb307aed970d1372dfd"
829
+ checksum = "db6d35d663eadb6c932438e763b262fe1a70987f9ae936e60158176d710cae4a"
796
830
  dependencies = [
797
831
  "zerocopy-derive",
798
832
  ]
799
833
 
800
834
  [[package]]
801
835
  name = "zerocopy-derive"
802
- version = "0.8.33"
836
+ version = "0.8.39"
803
837
  source = "registry+https://github.com/rust-lang/crates.io-index"
804
- checksum = "2c7962b26b0a8685668b671ee4b54d007a67d4eaf05fda79ac0ecf41e32270f1"
838
+ checksum = "4122cd3169e94605190e77839c9a40d40ed048d305bfdc146e7df40ab0f3e517"
805
839
  dependencies = [
806
840
  "proc-macro2",
807
841
  "quote",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "rust-geo-python"
3
- version = "0.1.6"
3
+ version = "0.1.8"
4
4
  authors = ["plooney"]
5
5
  edition = "2024"
6
6
  readme = "README.md"
@@ -10,12 +10,14 @@ name = "rust_geo_python"
10
10
  crate-type = ["cdylib"]
11
11
 
12
12
  [dependencies]
13
- pyo3 = { version = "0.27.1", features = ["extension-module", "abi3-py37"] }
14
- ndarray = {version="0.17.1", features = ["rayon"]}
13
+ pyo3 = { version = "0.27.2", features = ["extension-module", "abi3-py37", "generate-import-lib"] }
14
+ ndarray = {version="0.17.2", features = ["rayon"]}
15
15
  numpy = "0.27.1"
16
16
  geo = { version = "0.32.0" }
17
+ i_overlay = "4.0.7"
17
18
  wkt = "0.14.0"
18
- wkb = "0.9.1"
19
+ wkb = "0.9.2"
20
+ num-traits = "0.2.19"
19
21
 
20
22
  [profile.release]
21
23
  lto = true
@@ -33,3 +35,4 @@ rustflags = [
33
35
  "-C", "link-arg=-undefined",
34
36
  "-C", "link-arg=dynamic_lookup",
35
37
  ]
38
+
@@ -0,0 +1,149 @@
1
+ Metadata-Version: 2.4
2
+ Name: rust-geo-python
3
+ Version: 0.1.8
4
+ Author: plooney
5
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
6
+
7
+ # rust-geo-python
8
+
9
+ Fast 2D geometry for Python implemented in Rust. This project exposes `geo`-powered operations (distance, relations, boolean ops, buffering, etc.) to Python via PyO3 and NumPy arrays, with optional robust overlay helpers powered by `i_overlay`.
10
+
11
+ **Status:** early, API may change.
12
+
13
+ ## Features
14
+ - Python classes for core shapes: point, line, line string, polygon, multipolygon, rect, triangle, and geometry collections.
15
+ - Geometry operations: distance, containment, intersection/union/difference, buffer, area, validity checks, and relations.
16
+ - Vectorized distance helpers that operate on NumPy arrays.
17
+ - Optional robust overlay utilities for tiling workflows.
18
+
19
+ ## Install (from source)
20
+ This repo builds a Python extension with `maturin`.
21
+
22
+ Requirements:
23
+ - Rust toolchain (edition 2024)
24
+ - Python 3.7+ (uses `abi3-py37`)
25
+ - `maturin`
26
+
27
+ Build and install into the current Python environment:
28
+ ```bash
29
+ pip install maturin
30
+ maturin develop --release
31
+ ```
32
+
33
+ Build a wheel:
34
+ ```bash
35
+ maturin build --release
36
+ ```
37
+
38
+ ## Quick start
39
+ ```python
40
+ import numpy as np
41
+ import rust_geo_python as rg
42
+
43
+ # Points / lines
44
+ p = rg.RustPoint(1.0, 2.0)
45
+ line = rg.RustLine(0.0, 0.0, 3.0, 4.0)
46
+
47
+ # Polygons are defined by an exterior ring and optional interior rings
48
+ outer = np.array([[0.0, 0.0], [4.0, 0.0], [4.0, 4.0], [0.0, 4.0], [0.0, 0.0]])
49
+ hole = np.array([[1.0, 1.0], [2.0, 1.0], [2.0, 2.0], [1.0, 2.0], [1.0, 1.0]])
50
+ poly = rg.RustPolygon(outer, [hole])
51
+
52
+ print(poly.area())
53
+ print(poly.contains(p))
54
+ print(poly.to_wkt())
55
+ ```
56
+
57
+ Vectorized distance helpers:
58
+ ```python
59
+ points = np.array([[0.0, 0.0], [5.0, 5.0], [2.0, 3.0]])
60
+ polygon = np.array([[0.0, 0.0], [4.0, 0.0], [4.0, 4.0], [0.0, 4.0], [0.0, 0.0]])
61
+
62
+ dist = rg.points_polygon_distance(points, polygon)
63
+ print(dist)
64
+ ```
65
+
66
+ ## API overview
67
+ Python module: `rust_geo_python`
68
+
69
+ ### Classes
70
+ - `RustShape` (base class)
71
+ - `RustPoint`
72
+ - `RustLine`
73
+ - `RustLineString`
74
+ - `RustMultiPoint`
75
+ - `RustMultiLineString`
76
+ - `RustPolygon`
77
+ - `RustMultiPolygon`
78
+ - `RustTriangle`
79
+ - `RustRect`
80
+ - `RustGeometryCollection`
81
+ - `RustGeomVecCollection`
82
+ - `RustIntersectionMatrix`
83
+
84
+ ### Selected methods
85
+ `RustShape` provides:
86
+ - `distance(other)`
87
+ - `unsigned_area()`
88
+ - `hausdorff_distance(other)`
89
+ - `bounding_rect()`
90
+ - `contains(other)`
91
+ - `contains_properly(other)`
92
+ - `intersects(other)`
93
+ - `relate(other)` → `RustIntersectionMatrix`
94
+ - `is_valid()`
95
+ - `to_wkt()`
96
+ - `buffer(radius)`
97
+ - `intersection(other)`
98
+ - `union(other)`
99
+ - `difference(other)`
100
+ - `boundary()`
101
+
102
+ `RustPolygon` / `RustMultiPolygon`:
103
+ - `xy()` (NumPy arrays)
104
+ - `simplify(epsilon)`
105
+ - `area()`
106
+
107
+ `RustRect`:
108
+ - `xy()`
109
+ - `to_polygon()`
110
+
111
+ `RustGeomVecCollection`:
112
+ - `distance(other)` (pairwise distance matrix)
113
+
114
+ `RustGeometryCollection`:
115
+ - `len()`
116
+
117
+ ### Functions
118
+ - `point_polygon_distance(point_xy, polygon_xy)`
119
+ - `points_polygon_distance(points_xy, polygon_xy)`
120
+ - `points_polygon_dist_mut(points_xy, polygon_xy)` (parallelized)
121
+ - `polygon_polygon_distance(polygon_xy, polygon_xy)`
122
+ - `from_wkt(wkt_string)`
123
+ - `union(polygons)`
124
+ - `union_with_adapter(polygons, rect)`
125
+ - `intersection(polygon, polygon)`
126
+ - `intersect_tile(multipolygon, tile_polygon, rect)`
127
+ - `point_in_polygon(point, polygon)`
128
+ - `union_set_shapes(...)`
129
+ - `intersection_shapes(...)`
130
+ - `difference_shapes(...)`
131
+
132
+ ## Notes
133
+ - Coordinates are `float64`.
134
+ - Polygon rings are expected to be closed (first point == last point).
135
+ - Boolean ops on shapes currently support polygon and multipolygon combinations.
136
+ - `from_wkt` returns the most specific class (e.g., `RustPoint`, `RustPolygon`, `RustGeometryCollection`).
137
+ - `buffer()` is not supported for `RustGeometryCollection`.
138
+
139
+ ## Development
140
+ Run tests:
141
+ ```bash
142
+ cargo test
143
+ ```
144
+
145
+ Build the Python extension in dev mode:
146
+ ```bash
147
+ maturin develop
148
+ ```
149
+