public static Geometry readWKTString(String wkt,GeometryFactory geomFact) throws ParseException, IOException {
  WKTReader reader=new WKTReader(geomFact);
  WKTFileReader fileReader=new WKTFileReader(new StringReader(wkt),reader);
  List geomList=fileReader.read();
  if (geomList.size() == 1)   return (Geometry)geomList.get(0);
  return geomFact.createGeometryCollection(GeometryFactory.toGeometryArray(geomList));
}

public static Geometry readWKTString ( String wkt , GeometryFactory geomFact ) throws ParseException , IOException { WKTReader reader = new WKTReader ( geomFact ) ; WKTFileReader fileReader = new WKTFileReader ( new StringReader ( wkt ) , reader ) ; List geomList = fileReader . read ( ) ; if ( geomList . size ( ) == 1 ) return ( Geometry ) geomList . get ( 0 ) ; return geomFact . createGeometryCollection ( GeometryFactory . toGeometryArray ( geomList ) ) ; }
reads one or more wkt geometries from a string .
