Global aquatic ecosystems are essential to human existence and have deteriorated seriously in recent years. Understanding the influence mechanism of habitat variation on the structure of the food-web allows the effective recovery of the health of degraded ecosystems. Whereas most previous studies focused on the selection of driving habitat factors, the impact of habitat variation on the food-web structure was rarely studied, resulting in the low success rate of ecosystem restoration projects globally. This paper presents a framework for exploring the effects of spatial variations in water quality and hydrological habitat factors on the food-web structure in city waters. Indices for the evaluation of the food-web structure are first determined by integrating model-parameter extraction via literature refinement. The key water quality and hydrological factors are then determined by coupling canonical correspondence analysis with partial least squares regression. Their spatial variation is investigated using spatial autocorrelation. Finally, fuzzy clustering is applied to analyze the influence of the spatial variations in water quality and hydrological factors on the food-web structure. The results obtained in Ji'nan, the pilot city of water ecological civilization in China, show that the Shannon diversity index, connectance index, omnivory index, and the ratio of total primary production to the total respiration are important indicators of food-web structural change. They show that the driving factors affecting the aquatic food-web structure in Ji'nan are hydrological factors (e.g., river width, water depth, and stream flow), physical aspects of water quality (e.g., air temperature, water temperature, electrical conductivity, and transparency), and chemical aspects (e.g., potassium, dissolved oxygen, calcium, and total hardness). They also show that the stability of the food-web is more prone to spatial variations in water quality than in hydrological factors. Higher electrical conductivity, potassium, total hardness, and air temperature lead to deteriorated food-web structures, whereas better transparency improves structure and stability. We found that water and air temperature are the most important factors in the spatial variation of the food-web structure in the study area, followed by total hardness. Transparency is the least important factor. Large disparities and varied spatial distributions exist in the driving effects of water quality and hydrological factors across regions attributable to differences in geographical environments, water salinity (fresh vs. sea water), and environmental factors (e.g., water pollution). The above methods and results serve as a theoretical and scientific basis for a high success rate of aquatic ecosystem restoration projects in the study area and other cities worldwide.