Closed kunzhoudk closed 9 months ago
这是来自QQ邮箱的假期自动回复邮件。您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。
@kunzhoudk The intent of the OperatorSimplify is to check if geometries are valid to be stored in Esri databases. It is allowed to have self intersections in polylines in that case. We don't provide a method to check specifically for self intersections. However, if you want to check if geometry is simple for the OGC standard, that prohibits self intersections in addition to a few other things, you can use OperatorSimplifyOGC.isSimpleOGC method.
Closing this as designed.
I want to verify whether a polyline is simple (non self-intersecting). However, in the following example, the polyline is self-intersecting, yet it is identified as simple and non-self-intersecting. Am I using the incorrect method, or am I applying the method incorrectly?
public static void main(String[] args) { OperatorFactoryLocal factory = OperatorFactoryLocal.getInstance(); OperatorSimplify simplifyOp = (OperatorSimplify) factory.getOperator(Operator.Type.Simplify); // Create a self-intersecting polyline Polyline poly = new Polyline(); poly.startPath(0, 0); poly.lineTo(100, 100); poly.lineTo(0, 100); poly.lineTo(100, 0); boolean result = simplifyOp.isSimpleAsFeature(poly, null, false, null, null); assertTrue(result); }