Skip to content

Commit

Permalink
Updated tests
Browse files Browse the repository at this point in the history
Fixed missing arg in one call for ensureOrientation
  • Loading branch information
GitHub Actions committed Jun 14, 2023
1 parent 1a6c2d3 commit 57c1bea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -726,9 +726,9 @@ public JSONObject addPolygons(JSONObject geometry, ArrayList<ArrayList<Coordinat
Coordinate[] coordinates_array = geo.toArray(new Coordinate[geo.size()]);
List<Coordinate> orientedCoordinates;
if (orientation != desired_orientation) {
orientedCoordinates = Arrays.asList(
UMMUtils.ensureOrientation(desired_orientation, coordinates_array)
);
orientedCoordinates = Arrays.asList(
UMMUtils.ensureOrientation(desired_orientation, orientation, coordinates_array)
);
} else {
orientedCoordinates = Arrays.asList(coordinates_array);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public void testEnsureClockwise2CounterclockwisePolygon() throws ParseException
Geometry geometry = wktReader.read(clockwisePolygonWKT);
Coordinate[] coordinates = geometry.getCoordinates();
// the original input array's trailing 3 coordinates will become leading 3 coordinates
Coordinate[] reversedCoordinates = UMMUtils.ensureOrientation(CGAlgorithms.COUNTERCLOCKWISE, coordinates);
Coordinate[] reversedCoordinates = UMMUtils.ensureOrientation(CGAlgorithms.COUNTERCLOCKWISE, 0, coordinates);
assertTrue(reversedCoordinates[0].x == Double.valueOf(45.261678) &&
reversedCoordinates[0].y == Double.valueOf(-65.651128));
assertTrue(reversedCoordinates[1].x == Double.valueOf(45.36766) &&
Expand All @@ -132,7 +132,7 @@ public void testEnsureCounterclockwise2CounterclockwisePolygon() throws ParseExc
WKTReader wktReader = new WKTReader();
Geometry geometry = wktReader.read(clockwisePolygonWKT);
Coordinate[] coordinates = geometry.getCoordinates();
Coordinate[] sameSequenceCoordinates = UMMUtils.ensureOrientation(CGAlgorithms.COUNTERCLOCKWISE, coordinates);
Coordinate[] sameSequenceCoordinates = UMMUtils.ensureOrientation(CGAlgorithms.COUNTERCLOCKWISE, 0, coordinates);
assertTrue(sameSequenceCoordinates[0].x == Double.valueOf(-66.1897) &&
sameSequenceCoordinates[0].y == Double.valueOf(63.1972));
assertTrue(sameSequenceCoordinates[1].x == Double.valueOf(-83.1304) &&
Expand Down

0 comments on commit 57c1bea

Please sign in to comment.