I usually fly my drone up with the camera at 90 degrees and when the top of the roof is in the middle of the screen, I go up another 15-30 feet, to avoid crashing the drone. To conserve my
Mavic 2 Pro's batteries, I'll sometimes find this height with my backup
Mini 2.
I assume you're planning a mission for mapping or roof inspection. Keep in mind that some buildings have roofs with a height that varies. When I do industrial parks, the roof is usually at a consistent height (although the ground may be higher or lower at different points around the building).
Some of these buildings have (I don't know the architectural term, but) parts of the facade which are raised and stand out from the rest of the building. This is common at shopping centers such as Walmart, but I've also seen it in industrial parks.
And of course, some buildings simply have a sloping roof, so there's something else to take into consideration.
I think there is very little difference between a photo taken at (roof elevation) + 15 feet vs. one taken at +30 feet. It's best to err on the side of caution. In addition to losing a drone, you don't have to explain to a client why you need access to their roof to retrieve a drone.