Diabetic macular edema (DME) is the major cause of vision loss in patients with diabetic retinopathy (DR). The purpose of this study was to assess the prevalence of DR and DME in a community in China and to analyze the characteristics of their optical coherence tomography (OCT) images. This study was an incidence survey based on data from 108,132 residents living in the Beixinjing District, Shanghai, China. Patients with DME came from the local health network. OCT was performed in 151 eyes of 100 type 2 diabetes patients with DR and 102 eyes of normal control subjects. Totally 795 cases were examined, and 215 of them were diagnosed to have DR. The average thickness of the macular fovea was 195.56 µm in 151 eyes from 100 random samples. Forty-six eyes had macular thickening. The statistical analysis showed that there was a positive correlation between the thickness of the macular fovea and –log of best-corrected visual acuity (r = 0.2869, p = 0.0004) as well as the severity of DR (p = 0.0003). However, there was no statistical significance between DME and posterior vitreous detachment. The images of OCT in DME included 3 types. Best-corrected visual acuity moderately correlated with retinal thickness. The macular thickness correlated with the severity of DR but not with posterior vitreous detachment.