An in-depth analysis of the urban road network structure plays an essential role in understanding the distribution of urban functional area. To concentrate topologically densely connected road segments, communities of urban roads provide a new perspective to study the structure of the network. In this study, based on OpenStreetMap (OSM) roads and points-of-interest (POI) data, we employ the Infomap community detection algorithm to identify the hierarchical community in city roads and explore the shaping role roads play in urban space and their relation with the distribution of urban functional areas. The results demonstrate that the distribution of communities at different levels in Guangzhou, China reflects the urban spatial relation between the suburbs and urban centers and within urban centers. Moreover, the study explored the functional area characteristics at the community scale and identified the distribution of various functional areas. Owing to the structure information contained in the identification process, the detected community can be used as a basic unit in other urban studies. In general, with the community-based network, this study proposes a novel method of combining city roads with urban space and functional zones, providing necessary data support and academic guidance for government and urban planners