| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
package org.locationtech.jts.triangulate.quadedge; |
| 13 |
|
| 14 |
import org.locationtech.jts.geom.LineSegment; |
| 15 |
|
| 16 |
public class LocateFailureException |
| 17 |
extends RuntimeException |
| 18 |
{ |
| 19 |
private static String msgWithSpatial(String msg, LineSegment seg) { |
| 20 |
if (seg != null) |
| 21 |
return msg + " [ " + seg + " ]"; |
| 22 |
return msg; |
| 23 |
} |
| 24 |
|
| 25 |
private LineSegment seg = null; |
| 26 |
|
| 27 |
public LocateFailureException(String msg) { |
| 28 |
super(msg); |
| 29 |
} |
| 30 |
|
| 31 |
public LocateFailureException(String msg, LineSegment seg) { |
| 32 |
super(msgWithSpatial(msg, seg)); |
| 33 |
this.seg = new LineSegment(seg); |
| 34 |
} |
| 35 |
|
| 36 |
public LocateFailureException(LineSegment seg) { |
| 37 |
super( |
| 38 |
"Locate failed to converge (at edge: " |
| 39 |
+ seg |
| 40 |
+ "). Possible causes include invalid Subdivision topology or very close sites"); |
| 41 |
this.seg = new LineSegment(seg); |
| 42 |
} |
| 43 |
|
| 44 |
public LineSegment getSegment() { |
| 45 |
return seg; |
| 46 |
} |
| 47 |
|
| 48 |
} |
| 49 |
|