@@ -358,7 +358,7 @@ public void testPolygon() {
358
358
polygon = new Polygon (new LinearRing (new double [] { 1 , 0 , 0 , 1 , 1 }, new double [] { 1 , 1 , 0 , 0 , 1 }));
359
359
// for some reason, the normalizer always changes the order of the points
360
360
indexed = new Polygon (new LinearRing (new double [] { 0 , 0 , 1 , 1 , 0 }, new double [] { 1 , 0 , 0 , 1 , 1 }));
361
- ;
361
+
362
362
assertEquals (indexed , GeometryNormalizer .apply (Orientation .CCW , polygon ));
363
363
assertEquals (false , GeometryNormalizer .needsNormalize (Orientation .CCW , polygon ));
364
364
@@ -426,4 +426,37 @@ public void testMultiPolygon() {
426
426
assertEquals (indexed , GeometryNormalizer .apply (Orientation .CCW , multiPolygon ));
427
427
assertEquals (true , GeometryNormalizer .needsNormalize (Orientation .CCW , multiPolygon ));
428
428
}
429
+
430
+ public void testIssue82840 () {
431
+ Polygon polygon = new Polygon (
432
+ new LinearRing (
433
+ new double [] { -143.10690080319134 , -143.10690080319134 , 62.41055750853541 , -143.10690080319134 },
434
+ new double [] { -90.0 , -30.033129816260214 , -30.033129816260214 , -90.0 }
435
+ )
436
+ );
437
+ MultiPolygon indexedCCW = new MultiPolygon (
438
+ List .of (
439
+ new Polygon (
440
+ new LinearRing (
441
+ new double [] { 180.0 , 180.0 , 62.41055750853541 , 180.0 },
442
+ new double [] { -75.67887564489237 , -30.033129816260214 , -30.033129816260214 , -75.67887564489237 }
443
+ )
444
+ ),
445
+ new Polygon (
446
+ new LinearRing (
447
+ new double [] { -180.0 , -180.0 , -143.10690080319134 , -143.10690080319134 , -180.0 },
448
+ new double [] { -30.033129816260214 , -75.67887564489237 , -90.0 , -30.033129816260214 , -30.033129816260214 }
449
+ )
450
+ )
451
+ )
452
+ );
453
+ assertEquals (indexedCCW , GeometryNormalizer .apply (Orientation .CCW , polygon ));
454
+ Polygon indexedCW = new Polygon (
455
+ new LinearRing (
456
+ new double [] { -143.10690080319134 , 62.41055750853541 , -143.10690080319134 , -143.10690080319134 },
457
+ new double [] { -30.033129816260214 , -30.033129816260214 , -90.0 , -30.033129816260214 }
458
+ )
459
+ );
460
+ assertEquals (indexedCW , GeometryNormalizer .apply (Orientation .CW , polygon ));
461
+ }
429
462
}
0 commit comments