District heating (DH) can play a key role for a sustainable urban energy supply, especially in the presence of a building stock with high heat demands and several decades of useful life ahead. The economic viability of DH depends, among other things, on the distances between heat generators and customers and hence is not automatically given for each urban context.Many decision support tools for energy planning are currently being developed, which, though differing in complexity, always contain some kind of heat atlas, or heat cadastre – a thematic map representing spatially disaggregated heat demand. We propose extending this approach, combining built environment and urban space layout so that heat demands can be connected to heat infrastructure. Specifically, we analyse the linear heat density (the annual heat demand per metre of grid length) in order to inform strategic heat planning. We use a heat demand atlas, the street layout of the city of Hamburg and an algorithm based on graph theory to group buildings according to their closest street segment and then generate hypothetical heating grid layouts, which connect all buildings within a group. These hypothetical grids represent potential small heating grids or likely modules of a grid. We then transfer the heat demand information from the heat demand atlas to these hypothetical heating grids. That way, we create a dataset containing aggregated groups of buildings, their heat demand and a plausible assumption as to the grid layout and length required to connect them. We then use this dataset in a case study of Hamburg, Germany to (i) identify where potential expansions of existing and construction of new DH grids could take place, (ii) estimate effects of increasing the connection density within urban areas currently supplied by DH and (iii) simulate grid expansions while preserving the current average linear heat density.