The long-term reduction of the building stock's space heating and domestic hot water demand and its efficient and ecological supply can contribute significantly to climate change mitigation targets. In order to contribute to these targets, the economic aspects as well as the resulting CO2-emissions of potential future developments of the heat demand and its supply options have to be considered simultaneously. Especially in the case of existing grid-bound heating infrastructure, a wide range of decision-makers, including building owners, network operators and policy makers, are involved. Within the scope of this thesis, a model environment was developed which optimizes the investment paths for district heating and gas grids from the network operator's point of view. This optimization is based on the simulation of the long-term investment decisions of the building owners' with regard to thermal refurbishments and the installation of heating technologies. A spatially highly resolved implementation on registration district level allows the identification of district heating and gas target areas within considered regions. The integrated modelling approach is applied on the case study of Vienna. The model was calibrated with building stock data and technical and economical properties of the gas and district heating network infrastructure. Then, three scenarios were defined and analysed which take into account possible future developments of the economic development. Furthermore, additional analyses compare these scenarios regarding adapted legislative framework conditions and the complete substitution of the remaining gas demand by either district heating or decentral renewable energy sources. The results show a decrease of the buildings- heat demand from 2015 up to 2050 by 20 % to 40 %, depending on the considered scenario and assuming the current legislation. With regard to fulfil the Paris Agreement, a drastic decrease of the share of gas on the heating demand up to 2050 is required. But even in the most ambitious scenario, the share of gas in 2050 still accounts for 25 %. One possibility to achieve a further decrease of the gas demand is to adopt the current legislation and allow a flexible change from district heating to gas from a network operators' point of view. Then, the CO2-emissions can be reduced by further 8 % in 2050 and the total costs for heat distribution decreases by 2 %. In this case, the share of gas accounts for 14 % in 2050, while the share of district heating increases from 47 % to 64 %. Under the assumptions of the ambitious climate protection scenario, this share also corresponds to the economically viable share of the buildings- heat demand to be supplied by district heating, under the precondition that in 2050 the whole remaining gas demand has to be substituted either by renewable energy sources or by district heating.