A metropolitan area comprises a collection of cities and counties bound by strong socioeconomic ties. Despite the pivotal role that metropolitan areas play in regional economics, their delineation remains a challenging task for researchers and urban planners. Current threshold-based delineation methods select counties based on their connection strength with prespecified core counties. Such an approach often neglects potential interactions among outlying counties and fails to identify polycentric urban structures. The delineation of a metropolitan area is fundamentally a spatial optimization problem, whose objective is to identify a set of counties with high interconnectivity while also meeting specific constraints, such as area, contiguity, and shape. In this study, we present a novel spatial optimization model designed for metropolitan area delineation. This model aims to maximize intercounty connection strength in terms of both industry and daily life. This approach ensures a more accurate representation of the multicore structure that is commonly seen in developed metropolitan areas. Additionally, our model avoids the possibility of holes in metropolitan area delineation, leading to more coherent and logical metropolitan boundaries. We provide a mixed-integer programming formulation for the proposed model. Its efficacy is demonstrated by delineating the boundaries of the Nanjing and Lhasa metropolitan areas. This study also delves into discussions and policy implications pertinent to both of these metropolitan areas.