public static IGeometry PolygonizeCutEdges(IGeometry g) { var lines = LineStringExtracter.GetLines(g); var polygonizer = new Polygonizer(); polygonizer.Add(lines); var geom = polygonizer.GetCutEdges(); return g.Factory.BuildGeometry(CollectionUtil.Cast<ILineString, IGeometry>(geom)); }
public static IGeometry PolygonizeAllErrors(IGeometry g) { var lines = LineStringExtracter.GetLines(g); var polygonizer = new Polygonizer(); polygonizer.Add(lines); var errs = new List<ILineString>(); errs.AddRange(polygonizer.GetDangles()); errs.AddRange(polygonizer.GetCutEdges()); errs.AddRange(CollectionUtil.Cast<IGeometry, ILineString>(polygonizer.GetInvalidRingLines())); return g.Factory.BuildGeometry(CollectionUtil.Cast<ILineString, IGeometry>(errs)); }