1. In a recent paper, Bradburd et al. (Evolution, 67, 2013, 3258) proposed a model to quantify the relative effect of geographic and environmental distance on genetic differentiation. Here, we enhance this method in several ways. 2. We modify the covariance model so as to fit better with mainstream geostatistical models and avoid mathematically ill-behaved covariance functions. We extend the model – initially implemented only for co-dominant bi-allelic markers such as single nucleotide polymorphisms – to encompass highly polymorphic markers such as microsatellites. We implement and test a model selection procedure that allows users to assess which model (e.g. with or without an environment effect) is most suited. We code all our MCMC algorithms in a mix of compiled languages which allows us to decrease computing time by at least one order of magnitude. We propose an approximate inference and model selection method allowing us to deal with genomic data sets (several hundred thousands loci). 3. We also illustrate the potential of the method by re-analysing three data sets, namely harbour porpoises in Europe, coyotes in California and herrings in the Baltic Sea. 4. The computer program developed here is freely available as an r package called sunder. It takes as input georeferenced allele counts at the individual or population level for co-dominant markers. Program homepage: http://www2.imm.dtu.dk/~gigu/Sunder/.