Using OSM Data in QGIS

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
foreign openstreetmap is a huge collection of data contributed by Ordinary People it's the Wikipedia of data the amount of data here is incredible the entire world is covered but getting into qgis takes a few steps I'll show you how in this video there are several places to get osm data the osm website you can get data directly from the osm website it's not the most convenient method but it works here are the steps go to openstreetmap.org and sign up for an account once you're logged in Zoom to the area you want and click export at the top click the blue export button the file will be downloaded it will be in osm format in qgis click on the open data source manager button click the vector tab locate the osm file and click add the layers will appear in the map canvas you'll notice that the names of the labels aren't very helpful planet osm this website offers downloads of osm data for the entire Earth in a single file you might want to do that if you're insane the file is 128 gigabytes forget about this option geofabric this is a website that offers pre-made osm data sets for continents countries and states some of the osm data is in formats other than shapefiles but all U.S states in most countries are available as shape files if I need Vector data for another country this is my first stop here's the data set for Washington DC these data sets can be pretty big especially for countries or World regions so keep that in mind importing osm data directly into qgis the most practical way to get osm data for a project is to import it directly into qgis this lets you download only the data you need for your project there are several plugins for this I prefer to use Quick osm it's easy to use and always works first you need to load the plugin go to plugins manage and install plugins enter quick osm in the search field then click install plugin there's another plugin we also need and you might already have this one it's called quick map services while you're in the plugins window enter a quick map in the search field click on quick map services and install this one too back in the main qgis workspace go to web quickmapservices osm osm standard this will load the base map zoom into the area you want I'll zoom in to Boulder Colorado now we can get the osm data go to Vector quick osm quick osm the quick osm window will appear this is where you specify the kind of data you want at the top are two important Fields key and value key is the general category such as buildings and value is a specific type of data such as commercial there are three ways to work here the first way is to try to get all of the available data in one shot by doing a general query to do this leave the key and value Fields blank and set the menu to Canvas extent then click run query this tells osm to download all data available for the displayed area it can take a few minutes or it can fail completely you might get a message that says to choose a smaller area if that happens and you really need the entire area I'll explain a workaround in a few minutes you'll get a message when it's done close the window to see what you got that doesn't look so good for some reason osm always adds a solid color layer that doesn't seem to correspond to anything so turn that layer off now turn off the base map layer you'll see roads in a lot of points most of the points are traffic lights so I'll turn that layer off and I'm left with what look like roads that's the first way to work I usually don't do things that way for three reasons first trying to get all of the data at once often fails it's too much data to process this is especially likely if you're dealing with a large area such as an entire city the second reason is that for some reason doing a general query doesn't always return all of the data that's available you'll need to do specific queries to get that data the third reason I don't do things this way is how I organize my layers you'll notice that the layer labels aren't very helpful some of what appear to be roads are actually bus routes or bikeways so you need to check the attribute table for each layer to see what it is if you have a lot of layers determining what each of them is can be a hassle here's the second method this time I'll enter a term in the key field but leave the value field blank I'll use Highway that's the top level term for roads this will get all of the values for this particular key everything osm considers to be a highway here's what I get with that again I'll delete the points layer all of my roads are now in a single layer called Highway whereas in the first method the road layer was unlabeled using this method makes it easier to keep track of what you're doing without having to guess what the layers are I can run the split vector layer procedure on this layer to separate the road classes I'll do that now I'll go to Vector data management tools split vector layer this window appears I'll set the input layer to Highway the unique ID field to Highway that's the attribute osm uses to separate Road types and set output file type to SHP for shapefile I'll create a folder on my computer for the new files and click run once it's done you'll see the new folder in the file browser turn off the highways layer and add the layers you want from the new folder now you can easily control the kinds of Roads you have and style them accordingly the third way to work with quick osm is to specify both the key and a value this method takes the longest but you get layers that are already separated into discrete categories and this gives you maximum control over what you get this method can also pull in data that the other two methods don't before I do this I'll check the osm Wiki page to get the values I need I want to get Motorway trunk primary secondary and tertiary roads so I'll use those values I'll go to quick osm and enter Highway for the key and Motorway for the value don't forget to set canvas extent here's what I get I'll turn off the base map layer Point data in osm for roads is almost always traffic lights which I don't want so I'll delete that layer next is the trunk roads I'll enter that as the value this time I'll filter out the point layer by opening the advanced menu and unchecking the box for points here's what I get I'll repeat this for primary secondary and tertiary roads my layers are all labeled with the road type this makes it easy to keep track of things I'll add some quick styling to these roads to see them better and turn the base map layer back on here's a tip I usually lower the opacity of the base map layer to about 50 percent so I can see the actual data more easily large areas if you need data for a large area there's a good chance quick osm will return an error telling you to try a smaller area this is especially likely if you're trying a general query to get all of the data at once to get around this query your data in smaller chunks here I'm trying to get all the data of the greater Berlin area I get the error message so I'll try a query on the key highway first it runs for a while but I still get the error next I'll narrow the query to Highway Motorway and now I get something I can continue in this way to get the data I need it takes longer than a general query but it works and if you need a really big area start with one of the preset packages from the geofabric website tips osm data is not always complete so don't assume it is I've done projects where things like college campuses and military bases aren't included you will need to find other data sources for these things or you can manually digitize them in qgis I usually just draw them in illustrator it's not always clear which key and value osm uses for things you might get some of the missing things by doing a general query like in the first method I discussed here's what I mean I'll go back to quick osm and do a general query I get all of the roads but no buildings now I'll try a query for buildings and there they are they should have been included in the general query but weren't don't assume a general query will return everything you need another important point osm layers come into qgis as temporary layers don't forget to make them permanent check out my designer's guide to creating great maps at the mapguide.net guide and download two free chapters that's it for now see you next time
Info
Channel: Jess Zimmerman
Views: 3,457
Rating: undefined out of 5
Keywords:
Id: -tP06xIoIu0
Channel Id: undefined
Length: 10min 51sec (651 seconds)
Published: Mon Jun 12 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.