rust-geo-python 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.
@@ -0,0 +1,204 @@
1
+ # This file is autogenerated by maturin v1.9.4
2
+ # To update, run
3
+ #
4
+ # maturin generate-ci github
5
+ #
6
+ name: CI
7
+
8
+ on:
9
+ push:
10
+ branches:
11
+ - main
12
+ tags:
13
+ - '*'
14
+ pull_request:
15
+ workflow_dispatch:
16
+
17
+ permissions:
18
+ contents: read
19
+
20
+ jobs:
21
+ linux:
22
+ runs-on: ${{ matrix.platform.runner }}
23
+ strategy:
24
+ matrix:
25
+ platform:
26
+ - runner: ubuntu-22.04
27
+ target: x86_64
28
+ - runner: ubuntu-22.04
29
+ target: x86
30
+ - runner: ubuntu-22.04
31
+ target: aarch64
32
+ - runner: ubuntu-22.04
33
+ target: armv7
34
+ - runner: ubuntu-22.04
35
+ target: s390x
36
+ - runner: ubuntu-22.04
37
+ target: ppc64le
38
+ steps:
39
+ - uses: actions/checkout@v4
40
+ - uses: actions/setup-python@v5
41
+ with:
42
+ python-version: 3.x
43
+ - name: Build wheels
44
+ uses: PyO3/maturin-action@v1
45
+ with:
46
+ target: ${{ matrix.platform.target }}
47
+ args: --release --out dist
48
+ sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
49
+ manylinux: auto
50
+ - name: Build free-threaded wheels
51
+ uses: PyO3/maturin-action@v1
52
+ with:
53
+ target: ${{ matrix.platform.target }}
54
+ args: --release --out dist -i python3.13t
55
+ sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
56
+ manylinux: auto
57
+ - name: Upload wheels
58
+ uses: actions/upload-artifact@v4
59
+ with:
60
+ name: wheels-linux-${{ matrix.platform.target }}
61
+ path: dist
62
+
63
+ musllinux:
64
+ runs-on: ${{ matrix.platform.runner }}
65
+ strategy:
66
+ matrix:
67
+ platform:
68
+ - runner: ubuntu-22.04
69
+ target: x86_64
70
+ - runner: ubuntu-22.04
71
+ target: x86
72
+ - runner: ubuntu-22.04
73
+ target: aarch64
74
+ - runner: ubuntu-22.04
75
+ target: armv7
76
+ steps:
77
+ - uses: actions/checkout@v4
78
+ - uses: actions/setup-python@v5
79
+ with:
80
+ python-version: 3.x
81
+ - name: Build wheels
82
+ uses: PyO3/maturin-action@v1
83
+ with:
84
+ target: ${{ matrix.platform.target }}
85
+ args: --release --out dist
86
+ sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
87
+ manylinux: musllinux_1_2
88
+ - name: Build free-threaded wheels
89
+ uses: PyO3/maturin-action@v1
90
+ with:
91
+ target: ${{ matrix.platform.target }}
92
+ args: --release --out dist -i python3.13t
93
+ sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
94
+ manylinux: musllinux_1_2
95
+ - name: Upload wheels
96
+ uses: actions/upload-artifact@v4
97
+ with:
98
+ name: wheels-musllinux-${{ matrix.platform.target }}
99
+ path: dist
100
+
101
+ windows:
102
+ runs-on: ${{ matrix.platform.runner }}
103
+ strategy:
104
+ matrix:
105
+ platform:
106
+ - runner: windows-latest
107
+ target: x64
108
+ - runner: windows-latest
109
+ target: x86
110
+ steps:
111
+ - uses: actions/checkout@v4
112
+ - uses: actions/setup-python@v5
113
+ with:
114
+ python-version: 3.x
115
+ architecture: ${{ matrix.platform.target }}
116
+ - name: Build wheels
117
+ uses: PyO3/maturin-action@v1
118
+ with:
119
+ target: ${{ matrix.platform.target }}
120
+ args: --release --out dist
121
+ sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
122
+ - uses: actions/setup-python@v5
123
+ with:
124
+ python-version: 3.13t
125
+ architecture: ${{ matrix.platform.target }}
126
+ - name: Build free-threaded wheels
127
+ uses: PyO3/maturin-action@v1
128
+ with:
129
+ target: ${{ matrix.platform.target }}
130
+ args: --release --out dist -i python3.13t
131
+ sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
132
+ - name: Upload wheels
133
+ uses: actions/upload-artifact@v4
134
+ with:
135
+ name: wheels-windows-${{ matrix.platform.target }}
136
+ path: dist
137
+
138
+ macos:
139
+ runs-on: ${{ matrix.platform.runner }}
140
+ strategy:
141
+ matrix:
142
+ platform:
143
+ - runner: macos-13
144
+ target: x86_64
145
+ - runner: macos-14
146
+ target: aarch64
147
+ steps:
148
+ - uses: actions/checkout@v4
149
+ - uses: actions/setup-python@v5
150
+ with:
151
+ python-version: 3.x
152
+ - name: Build wheels
153
+ uses: PyO3/maturin-action@v1
154
+ with:
155
+ target: ${{ matrix.platform.target }}
156
+ args: --release --out dist
157
+ sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
158
+ - name: Build free-threaded wheels
159
+ uses: PyO3/maturin-action@v1
160
+ with:
161
+ target: ${{ matrix.platform.target }}
162
+ args: --release --out dist -i python3.13t
163
+ sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
164
+ - name: Upload wheels
165
+ uses: actions/upload-artifact@v4
166
+ with:
167
+ name: wheels-macos-${{ matrix.platform.target }}
168
+ path: dist
169
+
170
+ sdist:
171
+ runs-on: ubuntu-latest
172
+ steps:
173
+ - uses: actions/checkout@v4
174
+ - name: Build sdist
175
+ uses: PyO3/maturin-action@v1
176
+ with:
177
+ command: sdist
178
+ args: --out dist
179
+ - name: Upload sdist
180
+ uses: actions/upload-artifact@v4
181
+ with:
182
+ name: wheels-sdist
183
+ path: dist
184
+
185
+ release:
186
+ name: Release
187
+ runs-on: ubuntu-latest
188
+ environment: release
189
+ #if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
190
+ needs: [linux, musllinux, windows, macos, sdist]
191
+ permissions:
192
+ # Use to sign the release artifacts
193
+ id-token: write
194
+ # Used to upload release artifacts
195
+ contents: write
196
+ steps:
197
+ - uses: actions/download-artifact@v4
198
+ - 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
+
@@ -0,0 +1,5 @@
1
+ target/
2
+ Cargo.lock
3
+ .idea/
4
+ *.py
5
+ !Cargo.toml
@@ -0,0 +1,562 @@
1
+ # This file is automatically @generated by Cargo.
2
+ # It is not intended for manual editing.
3
+ version = 4
4
+
5
+ [[package]]
6
+ name = "allocator-api2"
7
+ version = "0.2.21"
8
+ source = "registry+https://github.com/rust-lang/crates.io-index"
9
+ checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923"
10
+
11
+ [[package]]
12
+ name = "approx"
13
+ version = "0.5.1"
14
+ source = "registry+https://github.com/rust-lang/crates.io-index"
15
+ checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6"
16
+ dependencies = [
17
+ "num-traits",
18
+ ]
19
+
20
+ [[package]]
21
+ name = "autocfg"
22
+ version = "1.5.0"
23
+ source = "registry+https://github.com/rust-lang/crates.io-index"
24
+ checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
25
+
26
+ [[package]]
27
+ name = "byteorder"
28
+ version = "1.5.0"
29
+ source = "registry+https://github.com/rust-lang/crates.io-index"
30
+ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
31
+
32
+ [[package]]
33
+ name = "crossbeam-deque"
34
+ version = "0.8.6"
35
+ source = "registry+https://github.com/rust-lang/crates.io-index"
36
+ checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51"
37
+ dependencies = [
38
+ "crossbeam-epoch",
39
+ "crossbeam-utils",
40
+ ]
41
+
42
+ [[package]]
43
+ name = "crossbeam-epoch"
44
+ version = "0.9.18"
45
+ source = "registry+https://github.com/rust-lang/crates.io-index"
46
+ checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e"
47
+ dependencies = [
48
+ "crossbeam-utils",
49
+ ]
50
+
51
+ [[package]]
52
+ name = "crossbeam-utils"
53
+ version = "0.8.21"
54
+ source = "registry+https://github.com/rust-lang/crates.io-index"
55
+ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
56
+
57
+ [[package]]
58
+ name = "earcutr"
59
+ version = "0.4.3"
60
+ source = "registry+https://github.com/rust-lang/crates.io-index"
61
+ checksum = "79127ed59a85d7687c409e9978547cffb7dc79675355ed22da6b66fd5f6ead01"
62
+ dependencies = [
63
+ "itertools",
64
+ "num-traits",
65
+ ]
66
+
67
+ [[package]]
68
+ name = "either"
69
+ version = "1.15.0"
70
+ source = "registry+https://github.com/rust-lang/crates.io-index"
71
+ checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719"
72
+
73
+ [[package]]
74
+ name = "equivalent"
75
+ version = "1.0.2"
76
+ source = "registry+https://github.com/rust-lang/crates.io-index"
77
+ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
78
+
79
+ [[package]]
80
+ name = "float_next_after"
81
+ version = "1.0.0"
82
+ source = "registry+https://github.com/rust-lang/crates.io-index"
83
+ checksum = "8bf7cc16383c4b8d58b9905a8509f02926ce3058053c056376248d958c9df1e8"
84
+
85
+ [[package]]
86
+ name = "foldhash"
87
+ version = "0.1.5"
88
+ source = "registry+https://github.com/rust-lang/crates.io-index"
89
+ checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2"
90
+
91
+ [[package]]
92
+ name = "geo"
93
+ version = "0.31.0"
94
+ source = "registry+https://github.com/rust-lang/crates.io-index"
95
+ checksum = "2fc1a1678e54befc9b4bcab6cd43b8e7f834ae8ea121118b0fd8c42747675b4a"
96
+ dependencies = [
97
+ "earcutr",
98
+ "float_next_after",
99
+ "geo-types",
100
+ "geographiclib-rs",
101
+ "i_overlay",
102
+ "log",
103
+ "num-traits",
104
+ "robust",
105
+ "rstar",
106
+ "spade",
107
+ ]
108
+
109
+ [[package]]
110
+ name = "geo-types"
111
+ version = "0.7.17"
112
+ source = "registry+https://github.com/rust-lang/crates.io-index"
113
+ checksum = "75a4dcd69d35b2c87a7c83bce9af69fd65c9d68d3833a0ded568983928f3fc99"
114
+ dependencies = [
115
+ "approx",
116
+ "num-traits",
117
+ "rayon",
118
+ "rstar",
119
+ "serde",
120
+ ]
121
+
122
+ [[package]]
123
+ name = "geographiclib-rs"
124
+ version = "0.2.5"
125
+ source = "registry+https://github.com/rust-lang/crates.io-index"
126
+ checksum = "f611040a2bb37eaa29a78a128d1e92a378a03e0b6e66ae27398d42b1ba9a7841"
127
+ dependencies = [
128
+ "libm",
129
+ ]
130
+
131
+ [[package]]
132
+ name = "hash32"
133
+ version = "0.3.1"
134
+ source = "registry+https://github.com/rust-lang/crates.io-index"
135
+ checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606"
136
+ dependencies = [
137
+ "byteorder",
138
+ ]
139
+
140
+ [[package]]
141
+ name = "hashbrown"
142
+ version = "0.15.5"
143
+ source = "registry+https://github.com/rust-lang/crates.io-index"
144
+ checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1"
145
+ dependencies = [
146
+ "allocator-api2",
147
+ "equivalent",
148
+ "foldhash",
149
+ ]
150
+
151
+ [[package]]
152
+ name = "heapless"
153
+ version = "0.8.0"
154
+ source = "registry+https://github.com/rust-lang/crates.io-index"
155
+ checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad"
156
+ dependencies = [
157
+ "hash32",
158
+ "stable_deref_trait",
159
+ ]
160
+
161
+ [[package]]
162
+ name = "heck"
163
+ version = "0.5.0"
164
+ source = "registry+https://github.com/rust-lang/crates.io-index"
165
+ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
166
+
167
+ [[package]]
168
+ name = "i_float"
169
+ version = "1.15.0"
170
+ source = "registry+https://github.com/rust-lang/crates.io-index"
171
+ checksum = "010025c2c532c8d82e42d0b8bb5184afa449fa6f06c709ea9adcb16c49ae405b"
172
+ dependencies = [
173
+ "libm",
174
+ ]
175
+
176
+ [[package]]
177
+ name = "i_key_sort"
178
+ version = "0.6.0"
179
+ source = "registry+https://github.com/rust-lang/crates.io-index"
180
+ checksum = "9190f86706ca38ac8add223b2aed8b1330002b5cdbbce28fb58b10914d38fc27"
181
+
182
+ [[package]]
183
+ name = "i_overlay"
184
+ version = "4.0.6"
185
+ source = "registry+https://github.com/rust-lang/crates.io-index"
186
+ checksum = "0fcccbd4e4274e0f80697f5fbc6540fdac533cce02f2081b328e68629cce24f9"
187
+ dependencies = [
188
+ "i_float",
189
+ "i_key_sort",
190
+ "i_shape",
191
+ "i_tree",
192
+ "rayon",
193
+ ]
194
+
195
+ [[package]]
196
+ name = "i_shape"
197
+ version = "1.14.0"
198
+ source = "registry+https://github.com/rust-lang/crates.io-index"
199
+ checksum = "1ea154b742f7d43dae2897fcd5ead86bc7b5eefcedd305a7ebf9f69d44d61082"
200
+ dependencies = [
201
+ "i_float",
202
+ ]
203
+
204
+ [[package]]
205
+ name = "i_tree"
206
+ version = "0.16.0"
207
+ source = "registry+https://github.com/rust-lang/crates.io-index"
208
+ checksum = "35e6d558e6d4c7b82bc51d9c771e7a927862a161a7d87bf2b0541450e0e20915"
209
+
210
+ [[package]]
211
+ name = "indoc"
212
+ version = "2.0.6"
213
+ source = "registry+https://github.com/rust-lang/crates.io-index"
214
+ checksum = "f4c7245a08504955605670dbf141fceab975f15ca21570696aebe9d2e71576bd"
215
+
216
+ [[package]]
217
+ name = "itertools"
218
+ version = "0.11.0"
219
+ source = "registry+https://github.com/rust-lang/crates.io-index"
220
+ checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57"
221
+ dependencies = [
222
+ "either",
223
+ ]
224
+
225
+ [[package]]
226
+ name = "libc"
227
+ version = "0.2.176"
228
+ source = "registry+https://github.com/rust-lang/crates.io-index"
229
+ checksum = "58f929b4d672ea937a23a1ab494143d968337a5f47e56d0815df1e0890ddf174"
230
+
231
+ [[package]]
232
+ name = "libm"
233
+ version = "0.2.15"
234
+ source = "registry+https://github.com/rust-lang/crates.io-index"
235
+ checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de"
236
+
237
+ [[package]]
238
+ name = "log"
239
+ version = "0.4.28"
240
+ source = "registry+https://github.com/rust-lang/crates.io-index"
241
+ checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432"
242
+
243
+ [[package]]
244
+ name = "matrixmultiply"
245
+ version = "0.3.10"
246
+ source = "registry+https://github.com/rust-lang/crates.io-index"
247
+ checksum = "a06de3016e9fae57a36fd14dba131fccf49f74b40b7fbdb472f96e361ec71a08"
248
+ dependencies = [
249
+ "autocfg",
250
+ "rawpointer",
251
+ ]
252
+
253
+ [[package]]
254
+ name = "memoffset"
255
+ version = "0.9.1"
256
+ source = "registry+https://github.com/rust-lang/crates.io-index"
257
+ checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
258
+ dependencies = [
259
+ "autocfg",
260
+ ]
261
+
262
+ [[package]]
263
+ name = "ndarray"
264
+ version = "0.16.1"
265
+ source = "registry+https://github.com/rust-lang/crates.io-index"
266
+ checksum = "882ed72dce9365842bf196bdeedf5055305f11fc8c03dee7bb0194a6cad34841"
267
+ dependencies = [
268
+ "matrixmultiply",
269
+ "num-complex",
270
+ "num-integer",
271
+ "num-traits",
272
+ "portable-atomic",
273
+ "portable-atomic-util",
274
+ "rawpointer",
275
+ "rayon",
276
+ ]
277
+
278
+ [[package]]
279
+ name = "num-complex"
280
+ version = "0.4.6"
281
+ source = "registry+https://github.com/rust-lang/crates.io-index"
282
+ checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495"
283
+ dependencies = [
284
+ "num-traits",
285
+ ]
286
+
287
+ [[package]]
288
+ name = "num-integer"
289
+ version = "0.1.46"
290
+ source = "registry+https://github.com/rust-lang/crates.io-index"
291
+ checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f"
292
+ dependencies = [
293
+ "num-traits",
294
+ ]
295
+
296
+ [[package]]
297
+ name = "num-traits"
298
+ version = "0.2.19"
299
+ source = "registry+https://github.com/rust-lang/crates.io-index"
300
+ checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
301
+ dependencies = [
302
+ "autocfg",
303
+ "libm",
304
+ ]
305
+
306
+ [[package]]
307
+ name = "numpy"
308
+ version = "0.26.0"
309
+ source = "registry+https://github.com/rust-lang/crates.io-index"
310
+ checksum = "9b2dba356160b54f5371b550575b78130a54718b4c6e46b3f33a6da74a27e78b"
311
+ dependencies = [
312
+ "libc",
313
+ "ndarray",
314
+ "num-complex",
315
+ "num-integer",
316
+ "num-traits",
317
+ "pyo3",
318
+ "pyo3-build-config",
319
+ "rustc-hash",
320
+ ]
321
+
322
+ [[package]]
323
+ name = "once_cell"
324
+ version = "1.21.3"
325
+ source = "registry+https://github.com/rust-lang/crates.io-index"
326
+ checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
327
+
328
+ [[package]]
329
+ name = "portable-atomic"
330
+ version = "1.11.1"
331
+ source = "registry+https://github.com/rust-lang/crates.io-index"
332
+ checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483"
333
+
334
+ [[package]]
335
+ name = "portable-atomic-util"
336
+ version = "0.2.4"
337
+ source = "registry+https://github.com/rust-lang/crates.io-index"
338
+ checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507"
339
+ dependencies = [
340
+ "portable-atomic",
341
+ ]
342
+
343
+ [[package]]
344
+ name = "proc-macro2"
345
+ version = "1.0.101"
346
+ source = "registry+https://github.com/rust-lang/crates.io-index"
347
+ checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de"
348
+ dependencies = [
349
+ "unicode-ident",
350
+ ]
351
+
352
+ [[package]]
353
+ name = "pyo3"
354
+ version = "0.26.0"
355
+ source = "registry+https://github.com/rust-lang/crates.io-index"
356
+ checksum = "7ba0117f4212101ee6544044dae45abe1083d30ce7b29c4b5cbdfa2354e07383"
357
+ dependencies = [
358
+ "indoc",
359
+ "libc",
360
+ "memoffset",
361
+ "once_cell",
362
+ "portable-atomic",
363
+ "pyo3-build-config",
364
+ "pyo3-ffi",
365
+ "pyo3-macros",
366
+ "unindent",
367
+ ]
368
+
369
+ [[package]]
370
+ name = "pyo3-build-config"
371
+ version = "0.26.0"
372
+ source = "registry+https://github.com/rust-lang/crates.io-index"
373
+ checksum = "4fc6ddaf24947d12a9aa31ac65431fb1b851b8f4365426e182901eabfb87df5f"
374
+ dependencies = [
375
+ "target-lexicon",
376
+ ]
377
+
378
+ [[package]]
379
+ name = "pyo3-ffi"
380
+ version = "0.26.0"
381
+ source = "registry+https://github.com/rust-lang/crates.io-index"
382
+ checksum = "025474d3928738efb38ac36d4744a74a400c901c7596199e20e45d98eb194105"
383
+ dependencies = [
384
+ "libc",
385
+ "pyo3-build-config",
386
+ ]
387
+
388
+ [[package]]
389
+ name = "pyo3-macros"
390
+ version = "0.26.0"
391
+ source = "registry+https://github.com/rust-lang/crates.io-index"
392
+ checksum = "2e64eb489f22fe1c95911b77c44cc41e7c19f3082fc81cce90f657cdc42ffded"
393
+ dependencies = [
394
+ "proc-macro2",
395
+ "pyo3-macros-backend",
396
+ "quote",
397
+ "syn",
398
+ ]
399
+
400
+ [[package]]
401
+ name = "pyo3-macros-backend"
402
+ version = "0.26.0"
403
+ source = "registry+https://github.com/rust-lang/crates.io-index"
404
+ checksum = "100246c0ecf400b475341b8455a9213344569af29a3c841d29270e53102e0fcf"
405
+ dependencies = [
406
+ "heck",
407
+ "proc-macro2",
408
+ "pyo3-build-config",
409
+ "quote",
410
+ "syn",
411
+ ]
412
+
413
+ [[package]]
414
+ name = "quote"
415
+ version = "1.0.41"
416
+ source = "registry+https://github.com/rust-lang/crates.io-index"
417
+ checksum = "ce25767e7b499d1b604768e7cde645d14cc8584231ea6b295e9c9eb22c02e1d1"
418
+ dependencies = [
419
+ "proc-macro2",
420
+ ]
421
+
422
+ [[package]]
423
+ name = "rawpointer"
424
+ version = "0.2.1"
425
+ source = "registry+https://github.com/rust-lang/crates.io-index"
426
+ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3"
427
+
428
+ [[package]]
429
+ name = "rayon"
430
+ version = "1.11.0"
431
+ source = "registry+https://github.com/rust-lang/crates.io-index"
432
+ checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f"
433
+ dependencies = [
434
+ "either",
435
+ "rayon-core",
436
+ ]
437
+
438
+ [[package]]
439
+ name = "rayon-core"
440
+ version = "1.13.0"
441
+ source = "registry+https://github.com/rust-lang/crates.io-index"
442
+ checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91"
443
+ dependencies = [
444
+ "crossbeam-deque",
445
+ "crossbeam-utils",
446
+ ]
447
+
448
+ [[package]]
449
+ name = "robust"
450
+ version = "1.2.0"
451
+ source = "registry+https://github.com/rust-lang/crates.io-index"
452
+ checksum = "4e27ee8bb91ca0adcf0ecb116293afa12d393f9c2b9b9cd54d33e8078fe19839"
453
+
454
+ [[package]]
455
+ name = "rstar"
456
+ version = "0.12.2"
457
+ source = "registry+https://github.com/rust-lang/crates.io-index"
458
+ checksum = "421400d13ccfd26dfa5858199c30a5d76f9c54e0dba7575273025b43c5175dbb"
459
+ dependencies = [
460
+ "heapless",
461
+ "num-traits",
462
+ "smallvec",
463
+ ]
464
+
465
+ [[package]]
466
+ name = "rust-geo-python"
467
+ version = "0.1.0"
468
+ dependencies = [
469
+ "geo",
470
+ "ndarray",
471
+ "numpy",
472
+ "pyo3",
473
+ ]
474
+
475
+ [[package]]
476
+ name = "rustc-hash"
477
+ version = "2.1.1"
478
+ source = "registry+https://github.com/rust-lang/crates.io-index"
479
+ checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
480
+
481
+ [[package]]
482
+ name = "serde"
483
+ version = "1.0.228"
484
+ source = "registry+https://github.com/rust-lang/crates.io-index"
485
+ checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
486
+ dependencies = [
487
+ "serde_core",
488
+ "serde_derive",
489
+ ]
490
+
491
+ [[package]]
492
+ name = "serde_core"
493
+ version = "1.0.228"
494
+ source = "registry+https://github.com/rust-lang/crates.io-index"
495
+ checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
496
+ dependencies = [
497
+ "serde_derive",
498
+ ]
499
+
500
+ [[package]]
501
+ name = "serde_derive"
502
+ version = "1.0.228"
503
+ source = "registry+https://github.com/rust-lang/crates.io-index"
504
+ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
505
+ dependencies = [
506
+ "proc-macro2",
507
+ "quote",
508
+ "syn",
509
+ ]
510
+
511
+ [[package]]
512
+ name = "smallvec"
513
+ version = "1.15.1"
514
+ source = "registry+https://github.com/rust-lang/crates.io-index"
515
+ checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
516
+
517
+ [[package]]
518
+ name = "spade"
519
+ version = "2.15.0"
520
+ source = "registry+https://github.com/rust-lang/crates.io-index"
521
+ checksum = "fb313e1c8afee5b5647e00ee0fe6855e3d529eb863a0fdae1d60006c4d1e9990"
522
+ dependencies = [
523
+ "hashbrown",
524
+ "num-traits",
525
+ "robust",
526
+ "smallvec",
527
+ ]
528
+
529
+ [[package]]
530
+ name = "stable_deref_trait"
531
+ version = "1.2.0"
532
+ source = "registry+https://github.com/rust-lang/crates.io-index"
533
+ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
534
+
535
+ [[package]]
536
+ name = "syn"
537
+ version = "2.0.106"
538
+ source = "registry+https://github.com/rust-lang/crates.io-index"
539
+ checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6"
540
+ dependencies = [
541
+ "proc-macro2",
542
+ "quote",
543
+ "unicode-ident",
544
+ ]
545
+
546
+ [[package]]
547
+ name = "target-lexicon"
548
+ version = "0.13.3"
549
+ source = "registry+https://github.com/rust-lang/crates.io-index"
550
+ checksum = "df7f62577c25e07834649fc3b39fafdc597c0a3527dc1c60129201ccfcbaa50c"
551
+
552
+ [[package]]
553
+ name = "unicode-ident"
554
+ version = "1.0.19"
555
+ source = "registry+https://github.com/rust-lang/crates.io-index"
556
+ checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d"
557
+
558
+ [[package]]
559
+ name = "unindent"
560
+ version = "0.2.4"
561
+ source = "registry+https://github.com/rust-lang/crates.io-index"
562
+ checksum = "7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3"
@@ -0,0 +1,24 @@
1
+ [package]
2
+ name = "rust-geo-python"
3
+ version = "0.1.0"
4
+ authors = ["plooney"]
5
+ edition = "2024"
6
+ readme = "README.md"
7
+
8
+ [lib]
9
+ name = "rust_geo_python"
10
+ crate-type = ["cdylib"]
11
+
12
+ [dependencies]
13
+ pyo3 = { version = "0.26.0", features = ["extension-module", "abi3-py37"] }
14
+ ndarray = {version="0.16", features = ["rayon"]}
15
+ numpy = "0.26.0"
16
+ geo = { version = "0.31.0" }
17
+
18
+ [workspace]
19
+
20
+ [tool.cibuildwheel.macos.environment]
21
+ MACOSX_DEPLOYMENT_TARGET = "10.12"
22
+
23
+ [tool.cibuildwheel]
24
+ skip = ["*-musllinux_i686"]
@@ -0,0 +1,8 @@
1
+ Metadata-Version: 2.4
2
+ Name: rust-geo-python
3
+ Version: 0.1.0
4
+ Author: plooney
5
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
6
+
7
+ # rust-geo-python
8
+
@@ -0,0 +1 @@
1
+ # rust-geo-python
@@ -0,0 +1,3 @@
1
+ [build-system]
2
+ build-backend = "maturin"
3
+ requires = ["maturin>=1.0,<2.0"]
@@ -0,0 +1,68 @@
1
+ use ndarray::parallel::prelude::ParallelIterator;
2
+ use numpy::ndarray::{Axis, Array1};
3
+ use numpy::{PyArray1, PyReadonlyArray1, PyReadonlyArray2, IntoPyArray};
4
+
5
+ use geo::{Point, LineString, Distance, Euclidean};
6
+ use ndarray::{ArrayView1, ArrayView2};
7
+ use ndarray::parallel::prelude::IntoParallelIterator;
8
+ use pyo3::{pymodule, types::{PyModule}, Bound, PyResult, Python};
9
+
10
+ #[pymodule]
11
+ #[pyo3(name = "rust_geo_python")]
12
+ fn polygon<'py>(m: &Bound<'py, PyModule>) -> PyResult<()> {
13
+
14
+ fn point_poly_distance(x: ArrayView1<f64>, y: ArrayView2<f64>) -> f64 {
15
+ let path = y.axis_iter(Axis(0))
16
+ .map(|x| Point::new(x[0], x[1]))
17
+ .collect::<LineString>();
18
+ //let polygon = Polygon::new(path, vec![]);
19
+ let point = Point::new(x[0], x[1]);
20
+ let distance = Euclidean.distance(&point,&path);
21
+ distance
22
+
23
+ }
24
+
25
+ #[pyfn(m)]
26
+ #[pyo3(name = "point_polygon_distance")]
27
+ fn point_poly_distance_py<'py>(
28
+ x: PyReadonlyArray1<'py, f64>,
29
+ y: PyReadonlyArray2<'py, f64>,
30
+ ) -> PyResult<f64> {
31
+ let x = x.as_array();
32
+ let y = y.as_array();
33
+ let distance = point_poly_distance(x, y);
34
+ Ok(distance)
35
+ }
36
+
37
+ #[pyfn(m)]
38
+ #[pyo3(name = "points_polygon_distance")]
39
+ fn points_poly_distance_py<'py>(
40
+ py: Python<'py>,
41
+ x: PyReadonlyArray2<'py, f64>,
42
+ y: PyReadonlyArray2<'py, f64>,
43
+ ) -> Bound<'py, PyArray1<f64>> {
44
+ let x = x.as_array();
45
+ let y = y.as_array();
46
+ let distances = x.axis_iter(Axis(0))
47
+ .map(|p| point_poly_distance(p,y))
48
+ .collect::<Array1<f64>>();
49
+ distances.into_pyarray(py)
50
+ }
51
+
52
+ #[pyfn(m)]
53
+ #[pyo3(name = "points_polygon_dist_mut")]
54
+ fn points_poly_distance_mut_py<'py>(
55
+ py: Python<'py>,
56
+ x: PyReadonlyArray2<'py, f64>,
57
+ y: PyReadonlyArray2<'py, f64>,
58
+ ) -> Bound<'py, PyArray1<f64>> {
59
+ let x = x.as_array();
60
+ let y = y.as_array();
61
+ let distances_vec = x.axis_iter(Axis(0)).into_par_iter()
62
+ .map(|p| point_poly_distance(p,y))
63
+ .collect::<Vec<f64>>();
64
+ distances_vec.into_pyarray(py)
65
+ }
66
+
67
+ Ok(())
68
+ }