Skip to content

Commit

Permalink
add test (reverse) PolygonUtil.containsLocation on user polygon (issu…
Browse files Browse the repository at this point in the history
…e-4-2)
  • Loading branch information
kb0 committed Jul 27, 2020
1 parent ca8b2e8 commit 923579b
Showing 1 changed file with 124 additions and 1 deletion.
125 changes: 124 additions & 1 deletion test/polygon_util_test.dart
Expand Up @@ -362,7 +362,7 @@ void main() {
makeList([2.5, 10, 1, 0]), makeList([15, 10, 0, -15, 0, 25, -1, 0]));
});

test('contains issue-4', () {
test('contains issue-4-1', () {
final polygon = makeList([
55.4695522,
25.3937088,
Expand Down Expand Up @@ -482,4 +482,127 @@ void main() {
LatLng(25.394104, 55.454473), polygon, true),
equals(false));
});

test('contains issue-4-2', () {
final polygon = makeList([
25.3937088,
55.4695522,
25.3945885,
55.4680877,
25.3952887,
55.4669666,
25.3955238,
55.4651588,
25.3957539,
55.4634045,
25.395926,
55.461688,
25.396064,
55.4603147,
25.3962459,
55.4590219,
25.396384,
55.4580186,
25.3967619,
55.4564952,
25.397467,
55.4557013,
25.3981769,
55.4548966,
25.3986979,
55.4546231,
25.3991751,
55.4543602,
25.3991849,
55.4540169,
25.3997689,
55.4538935,
25.4004544,
55.4537487,
25.4012299,
55.4535448,
25.4010844,
55.4526758,
25.4040403,
55.4519248,
25.4040112,
55.4517852,
25.4027515,
55.4487705,
25.4026156,
55.4485558,
25.4021663,
55.4480168,
25.4003286,
55.4498431,
25.3985452,
55.4510986,
25.3953276,
55.4533194,
25.393263,
55.454607,
25.3928947,
55.4548966,
25.3923422,
55.4551541,
25.3913827,
55.4552613,
25.3903843,
55.4551005,
25.3899676,
55.4553687,
25.389815,
55.4563611,
25.3897108,
55.4573321,
25.3895291,
55.4584693,
25.3894467,
55.4590433,
25.3892553,
55.4602503,
25.3891559,
55.4609638,
25.3889694,
55.4621171,
25.3890759,
55.4635441,
25.3893376,
55.4651105,
25.3897823,
55.4662719,
25.3902487,
55.4674708,
25.3906583,
55.4683774,
25.3910217,
55.4692679,
25.3916445,
55.4708289,
25.3917995,
55.4719017,
25.3937088,
55.4695522
]);

expect(
PolygonUtil.containsLocation(
LatLng(55.455251, 25.392898), polygon, true),
equals(false));

expect(
PolygonUtil.containsLocation(
LatLng(55.454473, 25.394104), polygon, true),
equals(false));

expect(
PolygonUtil.containsLocation(
LatLng(25.394104, 55.454473), polygon, true),
equals(true));

expect(
PolygonUtil.containsLocation(
LatLng(25.394104, 55.454473), polygon, true),
equals(true));
});
}

0 comments on commit 923579b

Please sign in to comment.