The phenomena of selection and coexistence are modelled as chemical pattern formation by competition for a given resource in heterogeneous spatial fields (fitness landscapes). The reactions form a closed reproductive cycle so that total concentration of species and their building-blocks is kept constant in time. Eigen's `constant overall organization' conditions can be view as a particular case of proposed conditions. Species whose fitness values exceed the replication threshold govern the system dynamics. In the limit of vanishing diffusion of species and full diffusional mixing of resource, all individuals share a common niche and only the fittest survives during an evolution. In the opposite limit of negligible diffusivity of resource, there is no competition between individuals and all of them coexist. At the intermediate values of resource diffusion, a number of long-lived spatial niches are formed, which lead to long-term coexistence of locally fittest individuals.