5

For the city of Berlin I have a digital elevation model as a 1x1 raster dataset from what I counted the slopes and I have shapefile data containing the outlines of buildings. My goal is to find flatroofs with preferably little fractionation.

Therefore I eliminated all pixel values with a slope higher than 3 degrees. An example of the result is seen in the picture. Now I would like to assess the "quality" of the roofs, so where the most area of flat pixels is "connected" like it is the case with the roof of the right building in the example vs. the more destructed roof on the left. As a result I would like to classify the roofs in little/medium/much destruction.

How do I approach this using QGIS?

enter image description here

2 Answers 2

6

You could run "Raster pixels to polygons", to convert your raster to a vector layer:

enter image description here

Make sure your Buildings have a unique id, then run "Intersection" with your Buildings:

![enter image description here

So your attribute table contains the slope value in degrees and the building id. Now add a new field, counting the cells each building contains count("buildingid","buildingid"):

enter image description here

And add a new field counting the cells lower than 3 degrees count("buildingid","buildingid","value"<3):

enter image description here

You can now calculate the percentage of each building, where the slope is lower than 3 degrees and use this as indicator.


Alternative:

Add a new field to your intersection layer, containing an inidcator wheter the value is smaller than 3 or not if("value"<3,1,0):

enter image description here

Now dissolve the layer by this new field as well as the buildingid:

enter image description here

enter image description here

Now run "Multipart to singlepart" to get individual areas. You can delete the field "value" now, to not get confused, it is no longer valid.

You can now either calculate the areas, the area percentage, count the number of "isolated" areas for each building, do a neighbour analysis, or whatever suits your usecase the best.

Or create an index, taking some things into account, like e.g.:

(
-- percentage of areas smaller 3 per building
sum($area,"buildingid","smaller3"=1) * 100 / sum($area,"buildingid")

*

-- number of areas smaller 3
count("buildingid","buildingid","smaller3"=1)
)
-
(
-- percentage of areas greater 3 per building
sum($area,"buildingid","smaller3"=0) * 100 / sum($area,"buildingid")

*

-- number of areas greater 3
count("buildingid","buildingid","smaller3"=0)
)

Which would for example turn back something like this: Note that this index is just an idea, its up to you how you would like to determine which areas are good for you and which are not!

enter image description here

2
  • Thanks a lot for your ideas! So my approach now is to count the perimeter of the vectorized slope raster and link them to the perimeter or the area of the roofs. Im only not so sure which of the latter is the best one to use. The result would be: the longer the length of the polygon perimeter compared to the perimeter or area of the roof is, the more fragmented the roof is. Does that make sense? Happy to hear an opinion
    – Tim
    Commented Jan 31, 2021 at 20:15
  • 1
    Sounds good to me personally. But I would not use the perimeter of the building for comparison, because this one can be smaller than the scattered polygons inside. Rather take the perimeter of all cells inside the building for comparison. However, in the end its up to you again. I dont know your task in detail ;)
    – MrXsquared
    Commented Jan 31, 2021 at 21:09
4

Berlin open data

CityGML

Just in case you aren't interested in the process, but just want to get the roof geometry:

Berlin offers a 3D model as CityGML : https://daten.berlin.de/datensaetze/lod2-geb%C3%A4udedaten-berlin

enter image description here

It is in "Level of Detail 2", which means that roof geometry is included:

enter image description here

You can select a region and enter your email address. Once the model is exported, you'll be notified.

Roof geometry

Once you get the CityGML model, you can display it in QGIS/SketchUp/FZKViewer or write scripts to calculate the roof inclination.

Here's an example for the district you've shown:

enter image description here

enter image description here

4
  • 1
    Thanks for your input! Im aware that the 3D model of berlin exists, but havent thought about it as a solution tbh.. now I prefer the other aproach though with a bit more complexity! Also Im not sure in what extend interruptions are treated in the 3D model..
    – Tim
    Commented Feb 1, 2021 at 18:01
  • @Tim: What do you mean with "interruptions"? Commented Feb 1, 2021 at 18:56
  • 1
    Often, like in the example in my question, flat roofs come with windows, gaps or other things on the roof "interrupting" the flatness of the roof. So I guess in the LOD2 3D model these things are not considered but its more generealised.
    – Tim
    Commented Feb 2, 2021 at 18:16
  • @Tim Okay, yes. The roof surfaces will mostly be large polygons, without any information if there are windows/chimneys/photovoltaic modules. For the largest surfaces, simply looking at a satellite view could tell you how much % looks available, for example. Commented Feb 2, 2021 at 20:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.