In Honduras, traditional coffee processing is the cause of two major problems: poor coffee quality and contaminated water. In this paper we present a method that determines the trade-off between economic efficiency and contamination in a Honduran sub-watershed. The method is a bioeconomic model based on mathematical programming that stimulates the functioning of the interlinked economic and ecological processes in the sub-watershed. We compare various scenarii where the model is given the possibility of replacing traditional coffee processing plants with a network of improved ecological plants. For different levels of contamination the model determines the optimal location and size of new coffee processing plants along river streams by minimizing transport, variable and fixed costs. The restrictions of the system are the volume of wet coffee to be processed, the available stream water, and in the alternative scenarii, investment capital and contaminant concentration in the river. We apply the method to a typical sub-watershed in the hillsides of western Honduras and show that coffee quality can be improved and contamination can be reduced substantially at a relatively low cost.