Solar energy deployment through PV installations in urban areas depends strongly on the shape, size, and orientation of available roofs. Here we use a machine learning approach, Support Vector Machine (SVM) classification, to classify 10,085 building roofs in relation to their received solar energy in the city of Geneva in Switzerland. The SVM correctly identifies six types of roof shapes in 66% of cases, that is, flat & shed, gable, hip, gambrel & mansard, cross/corner gable & hip, and complex roofs.We classify the roofs based on their useful area for PV installations and potential for receiving solar energy. For most roof shapes, the ratio between useful roof area and building footprint area is close to one, suggesting that footprint is a good measure of useful PV roof area. The main exception is the gable where this ratio is 1.18. The flat and shed roofs have the second highest useful roof area for PV (complex roof being the highest) and the highest PV potential (in GWh). By contrast, hip roof has the lowest PV potential. Solar roof-shape classification provides basic information for designing new buildings, retrofitting interventions on the building roofs, and efficient solar integration on the roofs of buildings.