Skip to content

Commit b319ce9

Browse files
committed
formatting
1 parent f7dbf75 commit b319ce9

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

src/main/java/mil/nga/sf/util/sweep/ShamosHoey.java

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@
1010

1111
/**
1212
* Shamos-Hoey simple polygon detection
13-
*
13+
* <p>
1414
* Based upon C++ implementation:
15-
* http://geomalgorithms.com/a09-_intersect-3.html
16-
*
15+
* <p>
16+
* <a href=
17+
* "http://geomalgorithms.com/a09-_intersect-3.html">http://geomalgorithms.com/a09-_intersect-3.html</a>
18+
* <p>
1719
* C++ implementation license:
18-
*
20+
* <p>
1921
* Copyright 2001 softSurfer, 2012 Dan Sunday This code may be freely used and
2022
* modified for any purpose providing that this copyright notice is included
2123
* with it. SoftSurfer makes no warranty for this code, and cannot be held
@@ -58,7 +60,8 @@ public static boolean simplePolygonPoints(List<Point> points) {
5860
* polygon point rings
5961
* @return true if simple, false if intersects
6062
*/
61-
public static boolean simplePolygonRingPoints(List<List<Point>> pointRings) {
63+
public static boolean simplePolygonRingPoints(
64+
List<List<Point>> pointRings) {
6265
List<LineString> rings = new ArrayList<>();
6366
for (List<Point> points : pointRings) {
6467
LineString ring = new LineString();
@@ -107,7 +110,8 @@ public static boolean simplePolygon(List<LineString> rings) {
107110
if (ringCopyPoints.size() >= 3) {
108111
Point first = ringCopyPoints.get(0);
109112
Point last = ringCopyPoints.get(ringCopyPoints.size() - 1);
110-
if (first.getX() == last.getX() && first.getY() == last.getY()) {
113+
if (first.getX() == last.getX()
114+
&& first.getY() == last.getY()) {
111115
ringCopyPoints.remove(ringCopyPoints.size() - 1);
112116
}
113117
}
@@ -151,7 +155,8 @@ public static boolean simplePolygon(List<LineString> rings) {
151155
if (event.getType() == EventType.LEFT) {
152156
Segment segment = sweepLine.add(event);
153157
if (sweepLine.intersect(segment, segment.getAbove())
154-
|| sweepLine.intersect(segment, segment.getBelow())) {
158+
|| sweepLine.intersect(segment,
159+
segment.getBelow())) {
155160
simple = false;
156161
break;
157162
}

0 commit comments

Comments
 (0)