I experimented with extracting the heights values from the drone imagery and add them to the building polygons traced in OpenStreetMap. Read along if you want to understand the process or just go here to see it in action here!
3D buildings around Foundation University, Dumaguete
Day 3 of Pista ng Mapa last Aug 3, 2019 was a series of field mapping activities. A couple of people did on the ground survey with field papers and mapillary. Our resident drone Mapher Leigh deployed her DJI Phantom 4 to survey the event venue and its surrounding community. Leigh uploaded all the drone derived data into OpenAerialMap including the elevation models! Using QGIS 3.6, I decided to explore ways to extract the heights from the derived DSM/DTM and use it for visualizing building polygons from OpenSteetMap.
For this exploration I used QGIS 3.6 with the GRASS GIS, Profile tool and QGIS2threejs plugin.
We will use the orthomosaic as a background base image for our visualization. The DSM and DTM layers will be used for extracting the height of buildings. I will not talk about the difference between DSM and DTM here, but here’s a nice explanation from gis.stackexchange.
The DSM and DTM we downloaded have different pixel resolution, to simplify the process, we will interpolate both raster pixel values to a coarser resolution of 1 meter.
To resample to a coarser grid, we will use the GRASS GIS modules in QGIS. In the Processing toolbox, search for the r.resamp.stats.
Select the DTM raster layer to resample, choose average for the Aggregation method and 1.0 for GRASS GIS region cell size.
Save the file in your machine. The parameters I used are shown below:
Once you finished resampling the DTM, do the same process for the DSM.
Nest step is to subtract the values from DSM to the DTM to get a raster layer that only has the difference between the two. This will be the height value we will use for the buildings.
To visualize the data, you can use the Profile Tool plugin like shown below:
Height in meters for each layer along the transect (red line in the map canvas). Red - calculated difference, blue - DSM, purple - DTM.
Now that we have the raster layer for the height, we will add these values to OSM buildings.
[out:xml]/*fixed by auto repair*/[timeout:25];
out meta;/*fixed by auto repair*/
out meta qt;/*fixed by auto repair*/
In order to get the height values from the calculated height difference raster, we need both layers in the same coordinate reference system (CRS).
EPSG:32651 - WGS 84 / UTM zone 51N - Projected
Now that we have all data in the same CRS, we can start adding the height data from the raster layer to the building polygon.
Our processing is finally complete! We can start visualizing the heights in QGIS using the QGIS2ThreeJS plugin.
"height__median" * 1.2
In such cases where there is a lot vegetation obscuring the building, median_height may not be be best metric to use.
This is not a full 3D, instead, it’s a “simple block model representation” (LOD1). My process cannot model roof structures or detailed architectural building models.
Can we use this process for mapping building:height in OpenStreetMap? Definitely, but this requires further calibration and ground validation. For example, I noticed height anomalies along the edge of the raster data. This is likely due to the height extraction used in processing the raw image files along the edges where there is not enough data.
Please share DSM/DTM data in OpenAerialMap. Extracting DSM/DTM from drone survey are fairly straightforward with the common processing tools like pix4d or OpenDroneMap. Although it will take more processing time, the benefits of using the DSM/DTM products along with the orthomosaic are huge. My appeal to all drone mappers uploading data in OpenAerialMap, please include the DSM/DTM. ;)
Give it a try with your own data and comment in this diary if I miss something. Happy mapping!
Comment from Omnific on 26 August 2019 at 20:15
Wow, that is really impressive. Some seriously professional work there!
Comment from jgruca on 27 August 2019 at 01:35
I’d be curious to hear more about the tools used for the drone survey. You mentioned pix4d and OpenDroneMap – did one of those create the orthomosaic and elevation data in this case? Was there software used to create a flight plan for the area?
Comment from muzirian on 27 August 2019 at 09:39
Wow this is amazing (*ﾟﾛﾟ)