Isolation by adaptation increases divergence at neutral loci when natural selection against immigrants reduces the rate of gene flow between different habitats. This can occur early in the process of adaptive divergence and is a key feature of ecological speciation. Despite the ability of isolation by distance (IBD) and other forms of landscape resistance to produce similar patterns of neutral divergence within species, few studies have used landscape genetics to control for these other forces. We have studied the divergence of Helianthus petiolaris ecotypes living in active sand dunes and adjacent non-dune habitat, using landscape genetics approaches, such as circuit theory and multiple regression of distance matrices, in addition to coalescent modelling. Divergence between habitats was significant, but not strong, and was shaped by IBD. We expected that increased resistance owing to patchy and unfavourable habitat in the dunes would contribute to divergence. Instead, we found that landscape resistance models with lower resistance in the dunes performed well as predictors of genetic distances among subpopulations. Nevertheless, habitat class remained a strong predictor of genetic distance when controlling for isolation by resistance and IBD. We also measured environmental variables at each site and confirmed that specific variables, especially soil nitrogen and vegetation cover, explained a greater proportion of variance in genetic distance than did landscape or the habitat classification alone. Asymmetry in effective population sizes and numbers of migrants per generation was detected using coalescent modelling with Bayesian inference, which is consistent with incipient ecological speciation being driven by the dune habitat.