[Geographiclib-announce] BUG (+ fix) in Java implementation of PolygonArea::TestEdge
Geographic library
Brought to you by:
karney
From: Charles K. <cha...@sr...> - 2019-05-07 19:12:03
|
There's a BUG in the PolygonArea::TestEdge routine in the Java implementation of GeographicLib. The following patch fixes this: diff --git a/java/src/main/java/net/sf/geographiclib/PolygonArea.java b/java/src/main/java/net/sf/geographiclib/PolygonArea.java index 1e4ed1a1..b7379bcc 100644 --- a/java/src/main/java/net/sf/geographiclib/PolygonArea.java +++ b/java/src/main/java/net/sf/geographiclib/PolygonArea.java @@ -338,10 +338,10 @@ public class PolygonArea { _earth.Direct(_lat1, _lon1, azi, false, s, _mask); tempsum += g.S12; crossings += transitdirect(_lon1, g.lon2); + crossings += transit(g.lon2, _lon0); g = _earth.Inverse(g.lat2, g.lon2, _lat0, _lon0, _mask); perimeter += g.s12; tempsum += g.S12; - crossings += transit(g.lon2, _lon0); } if ((crossings & 1) != 0) This will be included in the next release (version 1.50). |