How to create more 3D-like maps
Mapbox Studio has added extruded building polygons as of December 12. Let's make them anyway and see if we can do better?
Find the raster DEM and DSM for downtown Lexington and Shapefile of buildings with height attributes here: outrageGIS.com/pointclouds/data/lex_building_heights_from_lidar.zip (336 MB)
We need to add height information to building polygons. Unzip the data and add the digital elevation model, digital surface model, and building polygons.
The digital surface model (DSM) is height of all above-ground features, such as buildings, trees, etc. The digital elevation model (DEM) is the height of bare-earth ground. The raster datasets are created from Kentucky's lidar aerial mapping program. Check out our Wildcat Eyes presentation to learn how to find and download this remarkable amount of data.
Raster calculator to subtract bare-earth ground height from surface top to find height of above ground features.
Raster model of height of above-ground features.
Add polygons of building footprints.You find building polygons at Microsoft's US Building Footprints repo. These polygons are from the impervious layer hosted on Open Data Lexington. Building footprints can also be found for selected areas on OSM.
You might need to edit polygons that overlap, e.g., two adjacent buildings with a great difference in height.
Create zonal statistics for the above-ground heights for each building polygon. Attributes will be added to the polygon layer that shows the average, highest, and lowest height of intersecting above-ground features.
Inspect the attribute table. If buildings are 1,000 ft high, then you might have some more editing to do. First, what happened? Some lidar data might have captured birds flying or a building polygon might not be correctly located and it is intersecting a radio tower. You'll need to inspect the high buildings and determine a proper value from neighboring pixels.
After editing building heights, a recognizable pattern should emerge.
Create a hillshade of the above-ground features.
Export this layer as a GeoTIFF. We can add this to Mapbox Studio to add canopy top texture to our map.
Use QGIS 2.5D symbology method to preview effect in Mapbox.
Export building layer with minimal amount of attributes.
Import GeoTIFF of DSM and building polygons.
Select buildiung layer and Select data > Fill extrusion.
Convert building height to same units as Mapbox, i.e., meters.
Move raster layer beneath most of the vector layers and add opacity to raster layer.
Check it out live!















