class WktRemover {

    public String removeWktData(String line)
    {
        String modifiedLine = line;

        List<String> wktTypes = New.list(WktType.POLYGON.toString().toUpperCase(), WktType.LINESTRING.toString().toUpperCase(),
                WktType.LINEARRING.toString().toUpperCase(), WktType.MULTIPOINT.toString().toUpperCase(),
                WktType.MULTILINESTRING.toString().toUpperCase(), WktType.MULTIPOLYGON.toString().toUpperCase(),
                WktType.GEOMETRYCOLLECTION.toString().toUpperCase());

        for (String wktType : wktTypes)
        {
            if (modifiedLine.toUpperCase().contains(wktType))
            {
                modifiedLine = modifiedLine.toUpperCase();

                StringBuilder regex = new StringBuilder();
                regex.append(wktType);
                regex.append("\\s*+\\(.*\\)");

                modifiedLine = modifiedLine.replaceAll(regex.toString(), wktType);
            }
        }

        return modifiedLine;
    }

}