City prosperity index (CPI) is an instrument for measuring sustainability in cities. This instrument has a conceptual model called wheel of urban prosperity, which includes productivity, infrastructure equity and social inclusion, quality of life and environmental sustainability. Current methods of calculating CPI use global methods for different CPI dimensions, and in this study, we have suggested a local model of geographically weighting - called GWt-test - for measuring the CPI that can model spatial heterogeneity. The GWt-test method is an expansion of the classical hypothesis t-test models. In this method, for each feature, the hypothesis test is calculated individually. Geographically weighted matrixes are used to select samples. At first, the randomness and normalization of the selected set are tested. If confirmed, a GWt-test is performed on samples. The GWt-test can be non-directional or directional based on the p-value hypothesis; accept and reject. The results on CPI in Tehran highlighted spatial heterogeneities int two parts including a) north and south, and b) northeast to southwest. The proposed model examines spatial heterogeneity at the local level based on context and relationships between locations and provides better comparisons of neighborhoods. From this point if view, it provides a better understanding of urban issues. As a result, better strategies and policies are produced in urban plans and programs that ensure a long-term vision of urban development.