Biodiversity dynamics in heterogeneous landscapes is the result of a complex interplay between movement processes of organisms within and between habitat patches, and niche filtering processes due to spatially varying environmental conditions. Disentangling the relative influences of these different processes on community assembly and dynamics is a central theme of metacommunity ecology. We here propose to take advantage of the anisotropy of environmental variation in the vicinity of habitat edges to understand the drivers of spill-overs between habitats. We develop an analytical framework based on the analysis of the spatial turn-over in community composition at habitat edges. We then test this framework using metacommunity simulations. Finally, we apply this novel approach to an empirical case study on soil macrofauna at a forest-grassland interface. Our analytical framework evidences a very clear habitat-driven filtering of soil macrofauna at this forest-grassland edge, with no detectable influence of movement limitation. Various environmental variables are associated with this abrupt community turn-over, including litter amount and canopy cover, but also soil pH and Mg and Ca micronutrients.