Rising urban population throughout the world have boosted land use demand, intensifying pressure of ecological land resources linked with climate change. By incorporating risk into assessment, people can discourage excessive growth in megacity areas. Here, we propose a generalized analysis framework of ecological land conservation by devising a public goods game, which simultaneously considers population gravity and climate change along with interactions. Our method describes strategic conservation under the growth risk of urban boundary, where recurs across multiple rounds. We find that a compact and reasonable city with spatial structure will reduces erosion risk of ecological land and the lower costs of conservation, and higher its benefits. The conservation costs at the equilibrium do not increase with the degree of emphasis on the future, which show threshold effect. Ecological lands at the city boundaries have highest eroding risk, but rather pay a disproportionate amount of cost in this asymmetric game environment, which makes controlling erosion of ecological land less sustainable. Overall, our results suggest that implementing conservation strategies will efficiently reduce aggregate damages of urban growth and mitigate climate change, otherwise it may increase increases ecological land damages substantially.