-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
642: Introduce the geomgraph module for DE-9IM Relate trait r=frewsxcv,rmanoka a=michaelkirk - [x] I agree to follow the project's [code of conduct](https://github.com/georust/geo/blob/master/CODE_OF_CONDUCT.md). - [x] I added an entry to `CHANGES.md` if knowledge of this change could be valuable to users. --- This is just a dupe of #639, but targeting master. I'd forgotten #639 had targeted #636 (at the time, unmerged) for the purposes of minimizing the diff. ...I suppose an epically long PR wouldn't be complete without an epically long merge process. 😓 Co-authored-by: Michael Kirk <[email protected]>
- Loading branch information
Showing
38 changed files
with
3,587 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#[macro_use] | ||
extern crate criterion; | ||
extern crate geo; | ||
|
||
use crate::geo::relate::Relate; | ||
use criterion::Criterion; | ||
use geo::{LineString, Polygon}; | ||
|
||
fn criterion_benchmark(c: &mut Criterion) { | ||
c.bench_function("relate overlapping 50-point polygons", |bencher| { | ||
let points = include!("../src/algorithm/test_fixtures/norway_main.rs"); | ||
|
||
let sub_polygon = { | ||
let points = points[0..50].to_vec(); | ||
let mut exterior = LineString::<f32>::from(points); | ||
exterior.close(); | ||
Polygon::new(exterior, vec![]) | ||
}; | ||
|
||
let polygon = { | ||
let points = points[40..90].to_vec(); | ||
let mut exterior = LineString::<f32>::from(points); | ||
exterior.close(); | ||
Polygon::new(exterior, vec![]) | ||
}; | ||
|
||
bencher.iter(|| { | ||
criterion::black_box( | ||
criterion::black_box(&polygon).relate(criterion::black_box(&sub_polygon)), | ||
); | ||
}); | ||
}); | ||
} | ||
|
||
criterion_group!(benches, criterion_benchmark); | ||
criterion_main!(benches); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.