public IGeometry GetResultGeometry(SpatialFunction opCode) { IGeometry result = null; var isSuccess = false; try { result = OverlayOp.Overlay(geom[0], geom[1], opCode); var isValid = true; // not needed if noding validation is used // boolean isValid = OverlayResultValidator.isValid(geom[0], geom[1], OverlayOp.INTERSECTION, result); // if (isValid) isSuccess = true; } catch (Exception ex) { // Ignore this exception, since the operation will be rerun Debug.WriteLine(ex); } if (!isSuccess) { // This may still throw an exception - just let it go if it does result = SnapOverlayOp.Overlay(geom[0], geom[1], opCode); } return(result); }
/// <summary> /// /// </summary> /// <param name="g0"></param> /// <param name="g1"></param> /// <param name="opCode"></param> /// <returns></returns> public static IGeometry Overlay(IGeometry g0, IGeometry g1, SpatialFunction opCode) { SnapOverlayOp op = new SnapOverlayOp(g0, g1); return(op.GetResultGeometry(opCode)); }
/// <summary> /// /// </summary> /// <param name="g0"></param> /// <param name="g1"></param> /// <param name="opCode"></param> /// <returns></returns> public static IGeometry Overlay(IGeometry g0, IGeometry g1, SpatialFunction opCode) { SnapOverlayOp op = new SnapOverlayOp(g0, g1); return op.GetResultGeometry(opCode); }