Traditional villages are an important part of traditional culture, but with the process of urbanization, many traditional villages are gradually declining, and the protection and inheritance of traditional villages is a problem to be solved nowadays. This paper firstly locates the spatial type of traditional villages through spatial gene extraction methods such as element, objective law, structure and pattern extraction. Secondly, the spatial characteristics of traditional villages are summarized, the specific expressions of spatial genes are deconstructed, and the results of deconstruction are refined, so as to obtain the spatial genes of villages. Then the spatial syntax is introduced to analyze the spatial morphological features of traditional villages, construct the spatial gene map, and propose methodological countermeasures for the protection of traditional villages. Taking County G as an example, this paper mines the historical and geographical characteristics of five types of typical villages in the county city, and finds that the spatial gene richness can reflect the well-preserved degree of traditional village appearance and historical and cultural heritage, and the well-preserved degree of A2 village in the research sample is better. Based on the above research results, this paper designs the path of environmental landscape planning for traditional villages from three levels: auxiliary planning, digital quantification and digital protection. This paper expands the application path of digital technology in the revitalization of traditional village culture and provides an innovative approach to environmental landscape protection.