Elucidating the factors influencing genetic differentiation is an important task in biology, and the relative contribution from natural selection and genetic drift has long been debated. In this study, we used a regression-based approach to simultaneously estimate the quantitative contributions of environmental adaptation and isolation by distance on genetic variation in Boechera stricta, a wild relative of Arabidopsis. Patterns of discrete and continuous genetic differentiation coexist within this species. For the discrete differentiation between two major genetic groups, environment has larger contribution than geography, and we also identified a significant environment-by-geography interaction effect. Elsewhere in the species range, we found a latitudinal cline of genetic variation reflecting only isolation by distance. To further confirm the effect of environmental selection on genetic divergence, we identified the specific environmental variables predicting local genotypes in allopatric and sympatric regions. Water availability was identified as the possible cause of differential local adaptation in both geographical regions, confirming the role of environmental adaptation in driving and maintaining genetic differentiation between the two major genetic groups. In addition, the environment-by-geography interaction is further confirmed by the finding that water availability is represented by different environmental factors in the allopatric and sympatric regions. In conclusion, this study shows that geographical and environmental factors together created stronger and more discrete genetic differentiation than isolation by distance alone, which only produced a gradual, clinal pattern of genetic variation. These findings emphasize the importance of environmental selection in shaping patterns of species-wide genetic variation in the natural environment.