|
@@ -64,10 +64,12 @@ public class OverlapLinesFinder {
|
|
|
//双层循环遍历所有线
|
|
|
for (int i = 0; i < lines.size(); i++) {
|
|
|
GisSurveyLayerApplyLine line1 = lines.get(i);
|
|
|
+ if (line1.getGis() == null) continue;
|
|
|
//响应中断
|
|
|
if (Thread.interrupted()) throw new InterruptedException();
|
|
|
for (int j = i + 1; j < lines.size(); j++) {
|
|
|
GisSurveyLayerApplyLine line2 = lines.get(j);
|
|
|
+ if (line2.getGis() == null) continue;
|
|
|
//响应中断
|
|
|
if (Thread.interrupted()) throw new InterruptedException();
|
|
|
// 判断是否重叠
|
|
@@ -91,7 +93,7 @@ public class OverlapLinesFinder {
|
|
|
*/
|
|
|
public boolean calcOverlapLines(GisSurveyLayerApplyLine line1, GisSurveyLayerApplyLine line2) {
|
|
|
//取出四个点
|
|
|
- Coordinate a = line2.getGis().getCoordinateN(0);
|
|
|
+ Coordinate a = line1.getGis().getCoordinateN(0);
|
|
|
Coordinate b = line1.getGis().getCoordinateN(1);
|
|
|
Coordinate c = line2.getGis().getCoordinateN(0);
|
|
|
Coordinate d = line2.getGis().getCoordinateN(1);
|
|
@@ -100,7 +102,7 @@ public class OverlapLinesFinder {
|
|
|
//检查C和D是否在AB的直线上(叉积为0,则方向一致)
|
|
|
if (Orientation.index(a, b, c) != 0 || Orientation.index(a, b, d) != 0) return false;
|
|
|
LineSegment seg1 = new LineSegment(a, b);
|
|
|
- LineSegment seg2 = new LineSegment(a, b);
|
|
|
+ LineSegment seg2 = new LineSegment(c, d);
|
|
|
//四点共点判断
|
|
|
if (seg1.equals(seg2)) return true;
|
|
|
//获取C和D对于线段1的投影因子
|