Skip to content

Commit

Permalink
Replace deprecated CGAlgorithms.signedArea()
Browse files Browse the repository at this point in the history
  • Loading branch information
otbutz committed Apr 16, 2024
1 parent de4f3cd commit 13313a0
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ the License, or (at your option) any later version.

package com.graphhopper.isochrone.algorithm;

import org.locationtech.jts.algorithm.CGAlgorithms;
import org.locationtech.jts.algorithm.Area;
import org.locationtech.jts.geom.*;
import org.locationtech.jts.geom.prep.PreparedPolygon;
import org.locationtech.jts.triangulate.quadedge.Vertex;
Expand Down Expand Up @@ -125,7 +125,7 @@ private List<Polygon> punchHoles(List<LinearRing> rings) {
List<LinearRing> holes = new ArrayList<>(rings.size() / 2);
// 1. Split the polygon list in two: shells and holes (CCW and CW)
for (LinearRing ring : rings) {
if (CGAlgorithms.signedArea(ring.getCoordinateSequence()) > 0.0)
if (Area.ofRingSigned(ring.getCoordinateSequence()) > 0.0)
holes.add(ring);
else
shells.add(new PreparedPolygon(geometryFactory.createPolygon(ring)));
Expand Down Expand Up @@ -157,4 +157,4 @@ private List<Polygon> punchHoles(List<LinearRing> rings) {
}
return punched;
}
}
}

0 comments on commit 13313a0

Please sign in to comment.