Skip to content

Commit a129be4

Browse files
committed
tests: add test case from Java bug report
Cf. uber/h3-java#138
1 parent 9f2061b commit a129be4

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/api/geom/to_cells.rs

+16
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,22 @@ fn issue_23() {
437437
assert_eq!(count, 218_375);
438438
}
439439

440+
// https://github.com/uber/h3-java/issues/138
441+
#[test]
442+
fn bug_h3_java_138() {
443+
let poly = polygon![
444+
(x:11.147991,y:64.758157),
445+
(x:11.443969,y:64.758157),
446+
(x:11.443969,y:64.845147),
447+
(x:11.147991,y:64.845147)
448+
];
449+
let shape = Polygon::from_degrees(poly).unwrap();
450+
let config = PolyfillConfig::new(Resolution::Ten)
451+
.containment_mode(ContainmentMode::ContainsCentroid);
452+
let count = shape.to_cells(config).count();
453+
assert_eq!(count, 14_697);
454+
}
455+
440456
macro_rules! cell {
441457
($x: expr) => {{
442458
CellIndex::try_from($x).expect("valid cell")

0 commit comments

Comments
 (0)