The process of decarbonising economies has to take place on multiple levels. One of the objectives is to ensure renewables-based energy self-sufficiency of cities. Cities have become home to the majority of the world's population, and at the same time contribute enormously to environmental pollution. Considering the above, the purposes of this paper are threefold: to formulate a methodology for estimating rooftop photovoltaics (PV) potential in urban areas based on detailed Light Detection And Ranging (LiDAR) data; to calculate the spatial variability of load and photovoltaics energy supply, and thus to distinguish zones with various levels of energy self-sufficiency; and finally, to scrutinise the economic and environmental aspects of such a solution in given conditions. Wroclaw, the capital city of the Lower Silesia voivodeship in south-west Poland (Central Europe), was selected as a case study. The city has a population of close to 650,000 and an annual electricity consumption slightly exceeding 2.2 TWh. Industry constitutes 46% of that demand, and households 31%. The results show that up to 850 MW p of rooftop PV can be installed in the city, which has the potential to reduce the electrical energy related emissions by almost 30% and simultaneously to increase the city's energy self-sufficiency. Although energy storage, in the form of batteries, slightly improves both the autarky and environmental indices, the relation between potential PV generation and load makes them very infrequently useful (mostly in summer) and not economically justified.