Create True Height 3D Buildings in QGIS

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
foreign hi everybody you've probably seen images with cool 3D buildings like this here's the good news these images are easy to create in qgis if you have the right kind of data and now the bad news this data is nearly impossible to find for free but there's a commercial Source that's easy to use in this video I'll show you a couple different options but I'll focus on the method using the commercial data I've included a link in the description to some sample data you can use the basic steps of this technique are pretty simple load the building data with a height attribute into qgis use the height attribute to extrude the buildings to the correct height and render the scene in a 3D View it's easy to find building footprint data openstreetmap is a good source and many City and County GIS websites also make it available for free the problem is that this data almost never includes a height attribute which is the key to making this technique work while you can use ordinary building data without a height attribute with this technique the buildings will all be the same height not very interesting or useful there are ways to extract the height data from other data sources such as lidar but these are complicated and involve a lot of processing so I'm not going to cover them here there's a new data format called the city gml open City model that contains Building height data this data so far is only available for specific cities mostly in Europe but new data is being added there's also an emerging format for openstreetmap buildings but I haven't been able to get it to work consistently as this data becomes more available and useful I'll add more information about it in this video I'm going to focus on the commercially available data that's easy to use and always works correctly the one Geo website offers clean complete building Footprints with a height attribute it's comprehensive and easy to use one thing it's not is free that shouldn't be a problem if you're creating an image for a boss or client but it makes it harder to try things out they offer a free 50 coupon scroll down the page a bit to see it I recommend using this it might be enough for your area of Interest you'll need a domain-based email address to get it such as Sally at 123company.com you can't use an address that ends in gmail.com or anything like that there's also a link in the description of this video to download a data sample of my neighborhood once you get the coupon click on get data and you'll see this screen click search data or enter something in the search field here I've entered Chicago the data for the greater Chicago area goes for 3233 dollars here I've narrowed the area to part of the downtown I'll narrow it down further you can see the price drop as the area gets smaller this area is now within the fifty dollar limit of the coupon click the buy now button to go to the checkout page enter your information and the coupon code and you'll get your free data it will be a Json file now we go to qgis open qgis and load the Json file by dragging it onto the map Canvas OR layers panel apply a CRS here I've applied NAD 83 North Carolina note some online tutorials say you need to use a UTM CRS but any projected CRS will work don't use wgs 84. with your data in place there are two ways to create the 3D scene try them both to see what you prefer here's the first method double-click on the layer to open layer properties click the 3D view Tab and select single symbol from the top menu click to the right of the Extrusion field and select field type height click ok go to view new 3D map view expand the 3D window hold down the mouse wheel and move it up or down to Tilt The View use the mouse buttons to rotate the wheel and to zoom in or out and to move the image around qgis can only export 3D scenes as images not vectors on the 3D View Window there's an icon for save image as but it only produces a small low resolution image to get a better image go to Project new print layout make sure the 3D View Window is still open you can move it to the side to get it out of the way but don't close it in the print layout window click on the add 3D map icon and draw a box on the canvas it will say scene not set on the right side of the window click on the item properties Tab and click copy settings from a 3D View and choose 3D map 1. the 3D image will appear go to layout export as image name the file and choose a format then set the export resolution or pixel size as desired and click save additional options using the 3D view gives you several additional options for controlling the scene these can be accessed from the options menu here's a few of the more useful ones camera and Skybox this tab offers several useful options the first is a projection type the default setting is perspective projection which produces this look the buildings tilt away from one another the other setting is orthogonal projection which looks like this the buildings are all straight up and down the perspective projection also provides a field of view setting with a default setting of 45 degrees here's what 25 degrees looks like and here's 90 degrees qgis-23js method this second method uses a plugin called qgis23js download and install the plugin follow the same steps as the previous method open the one geojson file in qgis and apply a CRS go to web qgis23js qgis23js exporter a window will open check the one Geo box on the left side and the building Footprints will appear double-click on the one Geo layer to open the layer properties window set type to extruded and geometry height to height I also set the color and Edge color to feature style to pick up the fill and stroke colors I've already set for the data click ok the buildings will appear in 3D to get a white background under them check the flat plane box zoom in using the mouse wheel use the mouse buttons to adjust the rotation and position of the scene to save the image go to file save scene as image and enter the pixel dimensions you want if you want to increase the size Make sure you do it proportionally or the image will be distorted this method doesn't work with the normal print layout function outlined above and it sometimes has trouble saving files with a large pixel size which method should I use you can get similar results with both methods but they have their differences 3D view method this method gives the most control over the output options it also generates a cleaner vector image through illustrator's Trace image function which I'll talk about in a moment qgis23js this method produces a softer appearance than the 3D View and also adds small Shadows under the buildings it's harder to control the output resolution with this method entering a large pixel size can produce a blank output file using base Maps you can also add a base map to your 3D scene but there can be problems the base map won't export at a very high resolution how much of a problem this is depends on what you're trying to do here's how the local Semi-Pro baseball stadium looks in qgis using the esri imagery base map and here's how the exported file looks here's the same scene using the Google satellite base map that looks better if you're going to use a base map try several different ones to check the quality here's a really important tip if you're using the 3D view method and you're going to use a base map first set up the 3D view without adding the base map layer and adjust the zoom in rotation as desired once this is done add the base map layer in your main qgis window if you add the base map first qgis will have to add the base map in a series of tiles and this can take forever or not work at all when you set the 3D view first the base map appears quickly if you want to try other base Maps delete the active one from the main qgis layer palette then add the new one it will appear immediately in the 3D window without having to load any tiles if you really want 3D Vector buildings from qgis there is a way sort of once you export the image from qgis you can use illustrator's image Trace function to convert it into a vector image here are the steps using either the 3D view or qgis2 3js method export your scene at a reasonably high resolution here's the 3D view version and here's the qgis 2 3js version open the image in illustrator you can either create a new document and use the place function or just open the image directly here I've opened a 3D view version click on the image to select it and open the image Trace panel use these settings then click Trace when the trace is finished go to object expand and click ok you now have Vector objects note if you're going to use image trace the 3D view method produces better results the qjs23 version produces finer lines and small Shadows which don't always Trace well check out my designer's guide to creating great maps at the mapguide.net guide and download two free chapters that's all for now see you next time
Info
Channel: Jess Zimmerman
Views: 8,610
Rating: undefined out of 5
Keywords:
Id: mIphrr8uzDA
Channel Id: undefined
Length: 12min 14sec (734 seconds)
Published: Sun Apr 23 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.