Calculating Shortest and Fastest Paths using QGIS (ORS Tools)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi guys welcome to another tutorial in this tutorial I'm going to show you how to calculate the shortest path and the fastest path between two locations using qjs now as you can see over here this is my starting point somewhere over here which is the origin and I have my destination somewhere over here and based on this information I have calculated the fastest path which is represented in this blue line and the shortest path which is shown by this red color line using one of the very well-known plugins which we can use with QGIS so without further ado let's dive into the tutorial and find out how we can do that alright guys so to proceed with the tutorial we are going to require one additional plugin which is called ors tools so first of all what I'm going to do is I'm going to download this additional plugin by going to plugins and manage and install plugins and from here we can simply search for ORS tools which can be quite easily downloaded from the QGIS plugins repository as you can see over here it's open route service routing isochrones and metrics calculations for QGIS so we can just go ahead and install this plug-in first and just make sure that you are connected to internet while this is going on and after that you can simply close this alright so now we do have the ORS tools plug-in installed so the next thing that I would like to do is to add OpenStreetMap as a base layer now in order to do that I have already installed this quick map services and from quick map services I can simply add the OpenStreetMap to my mapping canvas now in case if you haven't installed quick map services you can simply install it just the way that we install this RS tools plugin you can simply go to plugins manage and install plugins and then and then install quick map services and once you do that you can simply go to osm and add the OSM standard so after you have that you can actually zoom into your area of interest now for this tutorial I will be using two cities in in Belgium now here we have the capital city of Belgium which is Brussels and then we have another small town over here called lovin so I'm going to actually try to calculate the shortest distance between some selected point in Brussels and in Louisville so first of all what I would like to do is I would go to web ors tools and open ors tools first now in order to proceed and use this ors tools first we have to sign up and get a special API key from open root service dot o-r-g so in order to do that you can simply just go to sign up over here and that will open up the web page of open root service dot o-r-g and from here simply just enter your username and the requested information in order to first register yourself I'm just going to go ahead and do that all right so once you complete your registration just go to your email address and activate your registration through the link which they provide and once you do that it will redirect you to this kind of a page where you can actually just simply log in from the information which you entered just like this and you can simply log in alright so once you reach this this dashboard you can simply select over here and request for a free token and as the name you can actually quite simply put any name that you would like maybe I'm just going to put the name of our channel and after that you can create a token which will eventually generate the API key right over here now of course for obvious reasons I'm carrying up my API key but in your case you can simply generate your own API key once you do that you can simply just copy on top of your API key and you can see that gives you the indication that your API key has now been copied to the clipboard and after that you can come back to your IRS tools over here and click on the Settings button and expand this open root service over here you can simply paste your API key and after that you can click OK so the first thing that I'm going to do is I'm going to specify my starting point so I'm just going to come back to the map maybe zoom in somewhere over here and let's say that I'm going to get started from this small city called Arabic and I will be selecting maybe let's say this Junction as my starting point now before that you can again actually go back to your artists tools and then decide a few things now are you going to go with driving car option or maybe walking option or cycling option that's actually up to you to decide so for this case since I'm actually going to cover a considerable amount of a distance I'm going to go with driving car option and I'm going to select let's say the fastest option now once you do that you can simply select this ad where points interactively from the map canvas button the plus sign once you do that you will see that your mouse cursor changes from from the pan icon to sort of a cross icon now what you can do is you can you can simply click on the starting point which you would like like this and my ending point is should be somewhere over here in Lovan so I'm going to zoom into somewhere in the middle of this city let's say maybe this point all right there's a supermarket right over here so let's say I would like to stop at this point so I'm going to add my second point right over here gives you sort of an indication your starting point and the ending point and let's say that I would like to sort of cross through this supermarket into a third point as well let's say I would like to maybe stop by maybe over here there's a fish market right over here once you want to finish your network you can actually instead of clicking once you can simply double click and that'll sort of complete your set of network we have point 0 1 & 2 and after that what you can do is you can simply click apply and it will generate the route for you over here you can see that we have a new layer now since the route itself is not so visible I'm just going to go to properties and maybe change the symbology a bit I can select simple line and maybe increase the maybe change the color to be something like let's say blue and increase the thickness as well a bit apply and click OK now you can see that the route which we are supposed to take if we were to travel from that particular point in Brussels in it from Arabic all the way up to this particular point in lovin through the supermarket which we wanted to stop by right over here and finish our trip at this fish market right over here now let's open up the attributes table of this and see what what sort of information we have now we have the distance in kilometers about 27 distance and we also have the duration in hours now when we have a distance and the duration of course you can calculate what sort of a speed they would calculate this to be now let's just for fun let's have a look at that we know that the distance is equal to the velocity multiplied by time so just let's say that we divide the distance which is twenty seven point nine three by the duration which is zero point four six one which is which comes out to be actually a decent speed about sixty kilometers per hour but of course if you're driving with the higher speed this duration is going to drop so that's one of the ways that you can calculate the fastest distance that you can actually use in order to get from get from point A up to point B through number of points as many as many points as you want this ORS tools actually can calculate the fastest distance or the shortest distance depending on your preference just out of curiosity let's find out what is the shortest distance now I can select shortest over here and click apply and you see that it actually creates the new shapefile a newline feature over here maybe I'll go and change the line color to be red so that we can distinguish the two lines quite clearly I'm expecting it should more or less be the same yeah you can see that right around here it's actually taking a different path which is basically the shortest distance and coming back to this main street somewhere over here and the rest is section and the rest of the rule is actually same as the fastest route now let's open up this one and see what sort of information we have yeah that distance is 25 as you can recall the previous distance was about 27 if I'm not mistaken years 27 so the so the shortest one is of course going to be lower than 27 but interestingly the duration is going to be higher over here you can see that the previous duration was how many hours was it it was about 0.46 one hours and the fastest and the shortest distance is about 0.796 hours so just you have to keep in mind that the shortest distance is not necessarily the fastest isn't it well that's one of the findings that we actually discovered right now through this tutorial all right guys that's about it for this tutorial in the second part of this tutorial we'll be look into a few more advanced functionalities of these ORS tools which we can find under these batch jobs over here before we wrap up this tutorial I would like to again remind to you guys if you haven't subscribed to our channel yet consider doing so because we will be publishing this kind of very interesting Jas and programming related tutorials a couple of times every week which can immensely help to advance your knowledge in your respective areas alright so I'll see you guys in the second part of this tutorial you
Info
Channel: GeoDelta Labs
Views: 38,488
Rating: undefined out of 5
Keywords: qgis, ArcGIS, ors tools, shortest path, fastest path, osmnx, open street maps, osm, how to, gis, network, roads, paths, routs, geographic, information, systems
Id: E-FAO5sF3dI
Channel Id: undefined
Length: 10min 1sec (601 seconds)
Published: Fri Jul 03 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.