It is widely acknowledged that space has an important role in population regulation, yet more specific knowledge into how the relevant factors interact attains little consensus. We address this issue via a stochastic, individual based model of population dynamics, in a continuous space continuous time framework. We represent habitat quality as a continuously varying surface over the two-dimensional landscape, and assume that the quality affects either fecundity (rate of propagule production) or probability of propagule establishment. We control the properties of the landscape by two parameters, which we call the patch size (the characteristic length scale in quality variation), and the level of heterogeneity (the characteristic quality difference between poor quality and high quality areas). In addition to such exogenous variability, we also account for endogenous factors causing spatial variation by assuming localised dispersal and competition. We find that heterogeneity has a general positive effect on population density, and hence it is beneficial to improve best quality habitat at the expense of worst quality habitat. With regards to patch size, we find an intermediate optimum, due to a conflict between minimising the loss of propagules to low quality regions and maximising the benefits of heterogeneity. We address the consequences of regional stochasticity by allowing the environmental conditions change in time. The cost of having to continuously track where the favourable conditions have moved to ultimately reduces population size.