Skip to content

Commit

Permalink
Merge #1026
Browse files Browse the repository at this point in the history
1026: haversine closest point fixups r=michaelkirk a=michaelkirk

- [x] I agree to follow the project's [code of conduct](https://github.com/georust/geo/blob/main/CODE_OF_CONDUCT.md).
- [x] I added an entry to `CHANGES.md` if knowledge of this change could be valuable to users.
---

Addendum to #958



Co-authored-by: Branimir Betov <[email protected]>
Co-authored-by: Corey Farwell <[email protected]>
Co-authored-by: Michael Kirk <[email protected]>
  • Loading branch information
4 people authored Jun 27, 2023
2 parents 79c23ea + de7f8f7 commit c448c41
Show file tree
Hide file tree
Showing 6 changed files with 632 additions and 5 deletions.
10 changes: 5 additions & 5 deletions geo-bool-ops-benches/benches/boolean_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fn run_complex<T: Measurement>(c: &mut Criterion<T>) {
|b, _| {
b.iter_batched(
polys.sampler(),
|&(ref poly, ref poly2, _, _)| poly.intersection(poly2),
|(poly, poly2, _, _)| poly.intersection(poly2),
BatchSize::SmallInput,
);
},
Expand All @@ -55,7 +55,7 @@ fn run_complex<T: Measurement>(c: &mut Criterion<T>) {
group.bench_with_input(BenchmarkId::new("bops::union", steps), &(), |b, _| {
b.iter_batched(
polys.sampler(),
|&(ref poly, ref poly2, _, _)| poly.union(poly2),
|(poly, poly2, _, _)| poly.union(poly2),
BatchSize::SmallInput,
);
});
Expand All @@ -66,7 +66,7 @@ fn run_complex<T: Measurement>(c: &mut Criterion<T>) {
|b, _| {
b.iter_batched(
polys.sampler(),
|&(_, _, ref poly, ref poly2)| OtherBooleanOp::intersection(poly, poly2),
|(_, _, poly, poly2)| OtherBooleanOp::intersection(poly, poly2),
BatchSize::SmallInput,
);
},
Expand All @@ -75,15 +75,15 @@ fn run_complex<T: Measurement>(c: &mut Criterion<T>) {
group.bench_with_input(BenchmarkId::new("rgbops::union", steps), &(), |b, _| {
b.iter_batched(
polys.sampler(),
|&(_, _, ref poly, ref poly2)| OtherBooleanOp::union(poly, poly2),
|(_, _, poly, poly2)| OtherBooleanOp::union(poly, poly2),
BatchSize::SmallInput,
);
});

group.bench_with_input(BenchmarkId::new("geo::relate", steps), &(), |b, _| {
b.iter_batched(
polys.sampler(),
|&(ref poly, ref poly2, _, _)| poly.relate(poly2).is_intersects(),
|(poly, poly2, _, _)| poly.relate(poly2).is_intersects(),
BatchSize::SmallInput,
);
});
Expand Down
4 changes: 4 additions & 0 deletions geo/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changes

## Unreleased

* Implement "Closest Point" from a `Point` on a `Geometry` using spherical geometry. <https://github.com/georust/geo/pull/958>

## 0.25.1

- Add `TriangulateEarcut` algorithm trait to triangulate polygons with the earcut algorithm.
Expand Down
Loading

0 comments on commit c448c41

Please sign in to comment.