public static IGeometry PolygonizeDangles(IGeometry g)
 {
     var lines = LineStringExtracter.GetLines(g);
     var polygonizer = new Polygonizer();
     polygonizer.Add(lines);
     var geom = polygonizer.GetDangles();
     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));
 }