public static Geometry polygonize(Geometry geom) { List lines = LineStringExtracter.getLines(geom); Polygonizer polygonizer = new Polygonizer(); polygonizer.add(lines); return geom.getFactory().buildGeometry(polygonizer.getPolygons()); }