Understanding geographic disparities in type 2 diabetes (T2D) requires approaches that account for communities' multidimensional nature. In an electronic health record nested case-control study, we identified 15,884 cases of new-onset T2D from 2008 to 2016, defined using encounter diagnoses, medication orders, and laboratory test results, and frequency-matched controls without T2D (79,400; 65,069 unique persons). We used finite mixture models to construct community profiles from social, natural, physical activity, and food environment measures. We estimated T2D odds ratios (OR) with 95% confidence intervals (CI) using logistic generalized estimating equation models, adjusted for sociodemographic variables. We examined associations with the profiles alone and combined them with either community type based on administrative boundaries or Census-based urban/rural status. We identified four profiles in 1069 communities in central and northeastern Pennsylvania along a rural-urban gradient: "sparse rural," "developed rural," "inner suburb," and "deprived urban core." Urban areas were densely populated with high physical activity resources and food outlets; however, they also had high socioeconomic deprivation and low greenness. Compared with "developed rural," T2D onset odds were higher in "deprived urban core" (1.24, CI = 1.16-1.33) and "inner suburb" (1.10, CI = 1.04-1.17). These associations with model-based community profiles were weaker than when combined with administrative boundaries or urban/rural status. Our findings suggest that in urban areas, diabetogenic features overwhelm T2D-protective features. The community profiles support the construct validity of administrative-community type and urban/rural status, previously reported, to evaluate geographic disparities in T2D onset in this geography.