The effects of the spatial structure of the environment on species coexistence and related consequences to local and regional community structure