rust-geo-python 0.1.0__tar.gz → 0.1.1__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.
@@ -464,7 +464,7 @@ dependencies = [
464
464
 
465
465
  [[package]]
466
466
  name = "rust-geo-python"
467
- version = "0.1.0"
467
+ version = "0.1.1"
468
468
  dependencies = [
469
469
  "geo",
470
470
  "ndarray",
@@ -528,9 +528,9 @@ dependencies = [
528
528
 
529
529
  [[package]]
530
530
  name = "stable_deref_trait"
531
- version = "1.2.0"
531
+ version = "1.2.1"
532
532
  source = "registry+https://github.com/rust-lang/crates.io-index"
533
- checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
533
+ checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596"
534
534
 
535
535
  [[package]]
536
536
  name = "syn"
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "rust-geo-python"
3
- version = "0.1.0"
3
+ version = "0.1.1"
4
4
  authors = ["plooney"]
5
5
  edition = "2024"
6
6
  readme = "README.md"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rust-geo-python
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Author: plooney
5
5
  Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
6
6
 
@@ -15,7 +15,6 @@ fn polygon<'py>(m: &Bound<'py, PyModule>) -> PyResult<()> {
15
15
  let path = y.axis_iter(Axis(0))
16
16
  .map(|x| Point::new(x[0], x[1]))
17
17
  .collect::<LineString>();
18
- //let polygon = Polygon::new(path, vec![]);
19
18
  let point = Point::new(x[0], x[1]);
20
19
  let distance = Euclidean.distance(&point,&path);
21
20
  distance
@@ -48,6 +47,25 @@ fn polygon<'py>(m: &Bound<'py, PyModule>) -> PyResult<()> {
48
47
  .collect::<Array1<f64>>();
49
48
  distances.into_pyarray(py)
50
49
  }
50
+ #[pyfn(m)]
51
+ #[pyo3(name = "polygon_polygon_distance")]
52
+ fn poly_poly_distance_py<'py>(
53
+ x: PyReadonlyArray2<'py, f64>,
54
+ y: PyReadonlyArray2<'py, f64>,
55
+ ) -> f64 {
56
+ let path_x = x
57
+ .as_array()
58
+ .axis_iter(Axis(0))
59
+ .map(|x| Point::new(x[0], x[1]))
60
+ .collect::<LineString>();
61
+ let path_y = y
62
+ .as_array()
63
+ .axis_iter(Axis(0))
64
+ .map(|x| Point::new(x[0], x[1]))
65
+ .collect::<LineString>();
66
+ let distance = Euclidean.distance(&path_x,&path_y);
67
+ distance
68
+ }
51
69
 
52
70
  #[pyfn(m)]
53
71
  #[pyo3(name = "points_polygon_dist_mut")]