@@ -1614,30 +1614,36 @@ public void delaunayTriangles() throws ParseException {
1614
1614
}
1615
1615
1616
1616
@ Test
1617
- public void spheroidLength () {
1617
+ public void spheroidLength () throws ParseException {
1618
1618
Point point = GEOMETRY_FACTORY .createPoint (new Coordinate (90 , 0 ));
1619
- assertEquals (0 , Spheroid .length (point ), 0.1 );
1619
+ assertEquals (0 , Spheroid .length (point ), FP_TOLERANCE2 );
1620
1620
1621
1621
LineString line = GEOMETRY_FACTORY .createLineString (coordArray (0 , 0 , 90 , 0 ));
1622
- assertEquals (1.0018754171394622E7 , Spheroid .length (line ), 0.1 );
1622
+ assertEquals (1.0018754171394622E7 , Spheroid .length (line ), FP_TOLERANCE2 );
1623
1623
1624
1624
Polygon polygon = GEOMETRY_FACTORY .createPolygon (coordArray (0 , 0 , 90 , 0 , 0 , 0 ));
1625
- assertEquals (2.0037508342789244E7 , Spheroid .length (polygon ), 0.1 );
1625
+ assertEquals (2.0037508342789244E7 , Spheroid .length (polygon ), FP_TOLERANCE2 );
1626
1626
1627
1627
MultiPoint multiPoint = GEOMETRY_FACTORY .createMultiPoint (new Point [] {point , point });
1628
- assertEquals (0 , Spheroid .length (multiPoint ), 0.1 );
1628
+ assertEquals (0 , Spheroid .length (multiPoint ), FP_TOLERANCE2 );
1629
1629
1630
1630
MultiLineString multiLineString =
1631
1631
GEOMETRY_FACTORY .createMultiLineString (new LineString [] {line , line });
1632
- assertEquals (2.0037508342789244E7 , Spheroid .length (multiLineString ), 0.1 );
1632
+ assertEquals (2.0037508342789244E7 , Spheroid .length (multiLineString ), FP_TOLERANCE2 );
1633
1633
1634
1634
MultiPolygon multiPolygon =
1635
1635
GEOMETRY_FACTORY .createMultiPolygon (new Polygon [] {polygon , polygon });
1636
- assertEquals (4.007501668557849E7 , Spheroid .length (multiPolygon ), 0.1 );
1636
+ assertEquals (4.007501668557849E7 , Spheroid .length (multiPolygon ), FP_TOLERANCE2 );
1637
1637
1638
1638
GeometryCollection geometryCollection =
1639
1639
GEOMETRY_FACTORY .createGeometryCollection (new Geometry [] {point , line , multiLineString });
1640
- assertEquals (3.0056262514183864E7 , Spheroid .length (geometryCollection ), 0.1 );
1640
+ assertEquals (3.0056262514183864E7 , Spheroid .length (geometryCollection ), FP_TOLERANCE2 );
1641
+
1642
+ Geometry polygonWithHole =
1643
+ Constructors .geomFromWKT (
1644
+ "POLYGON((-122.33 47.61, -122.32 47.62, -122.31 47.61, -122.30 47.62, -122.29 47.61, -122.30 47.60, -122.31 47.59, -122.32 47.60, -122.33 47.61), (-122.315 47.605, -122.305 47.615, -122.295 47.605, -122.305 47.595, -122.315 47.605))" ,
1645
+ 4326 );
1646
+ assertEquals (16106.506409488933 , Spheroid .length (polygonWithHole ), FP_TOLERANCE2 );
1641
1647
}
1642
1648
1643
1649
@ Test
0 commit comments