public static IGeometry FindSingleNodePoint(IGeometry geom) { FastNodingValidator nv = new FastNodingValidator(SegmentStringUtil.ExtractNodedSegmentStrings(geom)); bool temp = nv.IsValid; var intPts = nv.Intersections; if (intPts.Count == 0) return null; return FunctionsUtil.GetFactoryOrDefault((IGeometry)null).CreatePoint((Coordinate)intPts[0]); }
/// <summary> /// Gets a list of all intersections found. /// Intersections are represented as <see cref="Coordinate"/>s. /// List is empty if none were found. /// <param name="segStrings">A collection of SegmentStrings</param> /// <returns>a list of <see cref="Coordinate"/></returns> /// </summary> public static IList <Coordinate> ComputeIntersections(IEnumerable <ISegmentString> segStrings) { var nv = new FastNodingValidator(segStrings); nv.FindAllIntersections = true; bool temp = nv.IsValid; return(nv.Intersections); }
public static IGeometry CheckNoding(Geometry geom) { var segs = CreateSegmentStrings(geom); var nv = new FastNodingValidator(segs); nv.FindAllIntersections = true; var res = nv.IsValid; var intPts = nv.Intersections; var pts = new IPoint[intPts.Count]; for (var i = 0; i < intPts.Count; i++) { var coord = intPts[i]; // use default factory in case intersections are not fixed pts[i] = FunctionsUtil.GetFactoryOrDefault(null).CreatePoint(coord); } return FunctionsUtil.GetFactoryOrDefault(null).CreateMultiPoint( pts); }
///<summary> /// Creates a new validator for the given collection of <see cref="Edge"/>s. /// </summary> public EdgeNodingValidator(IEnumerable<Edge> edges) { _nv = new FastNodingValidator(ToSegmentStrings(edges)); }
private void Validate() { var nv = new FastNodingValidator(_nodedSs); nv.CheckValid(); }
public static IList<Coordinate> ComputeIntersections(IEnumerable<ISegmentString> segStrings) { FastNodingValidator nv = new FastNodingValidator(segStrings); nv.FindAllIntersections = true; bool temp = nv.IsValid; return nv.Intersections; }
public static bool IsNodingValid(IGeometry geom) { FastNodingValidator nv = new FastNodingValidator(SegmentStringUtil.ExtractNodedSegmentStrings(geom)); return nv.IsValid; }