Skip to content

Commit 57c1bea

Browse files
author
GitHub Actions
committed
Updated tests
Fixed missing arg in one call for ensureOrientation
1 parent 1a6c2d3 commit 57c1bea

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/main/java/gov/nasa/cumulus/metadata/aggregator/UMMGranuleFile.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -726,9 +726,9 @@ public JSONObject addPolygons(JSONObject geometry, ArrayList<ArrayList<Coordinat
726726
Coordinate[] coordinates_array = geo.toArray(new Coordinate[geo.size()]);
727727
List<Coordinate> orientedCoordinates;
728728
if (orientation != desired_orientation) {
729-
orientedCoordinates = Arrays.asList(
730-
UMMUtils.ensureOrientation(desired_orientation, coordinates_array)
731-
);
729+
orientedCoordinates = Arrays.asList(
730+
UMMUtils.ensureOrientation(desired_orientation, orientation, coordinates_array)
731+
);
732732
} else {
733733
orientedCoordinates = Arrays.asList(coordinates_array);
734734
}

src/test/java/gov/nasa/cumulus/metadata/aggregator/UMMUtilsTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public void testEnsureClockwise2CounterclockwisePolygon() throws ParseException
112112
Geometry geometry = wktReader.read(clockwisePolygonWKT);
113113
Coordinate[] coordinates = geometry.getCoordinates();
114114
// the original input array's trailing 3 coordinates will become leading 3 coordinates
115-
Coordinate[] reversedCoordinates = UMMUtils.ensureOrientation(CGAlgorithms.COUNTERCLOCKWISE, coordinates);
115+
Coordinate[] reversedCoordinates = UMMUtils.ensureOrientation(CGAlgorithms.COUNTERCLOCKWISE, 0, coordinates);
116116
assertTrue(reversedCoordinates[0].x == Double.valueOf(45.261678) &&
117117
reversedCoordinates[0].y == Double.valueOf(-65.651128));
118118
assertTrue(reversedCoordinates[1].x == Double.valueOf(45.36766) &&
@@ -132,7 +132,7 @@ public void testEnsureCounterclockwise2CounterclockwisePolygon() throws ParseExc
132132
WKTReader wktReader = new WKTReader();
133133
Geometry geometry = wktReader.read(clockwisePolygonWKT);
134134
Coordinate[] coordinates = geometry.getCoordinates();
135-
Coordinate[] sameSequenceCoordinates = UMMUtils.ensureOrientation(CGAlgorithms.COUNTERCLOCKWISE, coordinates);
135+
Coordinate[] sameSequenceCoordinates = UMMUtils.ensureOrientation(CGAlgorithms.COUNTERCLOCKWISE, 0, coordinates);
136136
assertTrue(sameSequenceCoordinates[0].x == Double.valueOf(-66.1897) &&
137137
sameSequenceCoordinates[0].y == Double.valueOf(63.1972));
138138
assertTrue(sameSequenceCoordinates[1].x == Double.valueOf(-83.1304) &&

0 commit comments

Comments
 (0)