Welcome, this is my first post. I have vector layer with buildings heights and vector/raster DEM file. I need to create solar maps with sun radiance values on the roof (and on surface, ofc). I am trying merge buildings with DEM, but I dont know how excatly to do it. I converted vector buildings to raster, made pixels outside buildings to null, and tried merge this file in 'r.mapcalc'. I think I should use 'if' function, but I dont know to how. Could anybody help me with it? It is possible to make flat surface in DEM under buidings in order to place buildings there?
The solution i would use to solve this problem is:
- Rasterize the building vector layer on the same extent/resolution as the DEM to get a raster with height values where are Buildings and NoData elsewhere (with v.to.rast.attribute for example)
- Performing an addition of this two raster with a raster Calculator (r.mapcalc for example)
This would result in a DEM where the building height will be add to the ground height where there is a building.
Generall solution for this kind of tasks:
Every desent GIS SW have tools that extract raster value into vector layer. They will attach on single button click to every point from the vector layer the corresponding underlaying raster value (kind of interpolation).
Now, building is polygon of lines. These kind of tools work usually on points. There are several approaches:
Work on building vertices
Transform building to single point at his centroid
Break each line to several points until the desired resolution