code: public static String toWkt(Geometry geometry) throws WktException {
  		if (Geometry.POINT.equals(geometry.getGeometryType())) {
  			return toWktPoint(geometry);
  		} else if (Geometry.LINE_STRING.equals(geometry.getGeometryType())
  				|| Geometry.LINEAR_RING.equals(geometry.getGeometryType())) {
  			return toWktLineString(geometry);
  		} else if (Geometry.POLYGON.equals(geometry.getGeometryType())) {
  			return toWktPolygon(geometry);
  		} else if (Geometry.MULTI_POINT.equals(geometry.getGeometryType())) {
  			return toWktMultiPoint(geometry);
  		} else if (Geometry.MULTI_LINE_STRING.equals(geometry.getGeometryType())) {
  			return toWktMultiLineString(geometry);
  		} else if (Geometry.MULTI_POLYGON.equals(geometry.getGeometryType())) {
  			return toWktMultiPolygon(geometry);
  		}
  		return "";
  	}
docs: Format a given geometry to Well Known Text.
  
  @param geometry
  The geometry to format.
  @return Returns the WKT string.
  @throws WktException
  In case something went wrong while formatting.