Checking out the Open Source Routing Machine

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up folks its toe in here and you're probably thinking yourselves that too and he knows everything well let me tell you something I I don't I don't know very many things in GIS particular there are a couple different areas I haven't really ever ventured into one of them is remote sensing all those pixels look the same to me and the other is routing I've never done a whole lot with routing Mecklenburg County has the same kind of routing needs every government has got to get your police cars and your fire trucks and the ambulances different places and you got a route building inspectors and garbage trucks but we've always had canned vendor solutions to all that stuff so I've had to help massage data into these different things for a 9-1-1 mecklenburg actually had three different systems at one time one for medic one for fire wonderful police cuz reasons so I've done that but for my routing for my needs it's usually a point-to-point like hey here's where you go vote you want to know how to get there and I will throw your rag oogle Maps because that's probably what you want you can send that straight to your phone which is gonna route you there it'll have options to route you there by bus or other things that may not have myself that's usually the way to go but I wanted to look around and I found this thing go unsure it wasn't because it's awesome if I can find it this open source routing machine which I'm sure everybody that really does routing already knows about and this will be very boring for you but I'd never really seen this or if I did I forgot because I'm not into routing what this can do is take a data dump from OpenStreetMap and just magically set up all your routing for you complete with an API you can call from from whatever you're using from your website and it is nuts fast so they very conveniently have a docker image for it and setting it up is super simple what you'll do is extract a a OpenStreetMap chunk from geo fabric or wherever and what I usually I'm doing this anyway to build our our vector tiles so I've got this laying around and you run three commands on it and this is just prepping the data and they'll run fairly quickly and you'll end up with this was my starting OpenStreetMap dump and it generates all of these other files for you and these are all the files that's going to use to do its routing and I don't know what say in animes thing salt it's all magic to me but you just run a few commands through docker you'll need dr. of course and it builds all this stuff once that stuff's built it's built you can copy that up to a hoe web server host somewhere and you just start the docker server pointing it at this OS RM data and you are golden you are serving routes like nobody's business and you're serving them superfast these numbers here are not lying to you this is how fast it is coming up with routes it's it's how how does it do that I don't know I'm using curl here for a benchmark because there is I try to patchy bench but when it responds with the request it's like a patchy bench doesn't figure out that it's done and it sits there and waits a long time so it looks weird you see here through curl it is super crazy fast and it's spitting back Jason you go to the project site and you go to their documentation you'll see all the various routes you can use there's a route service there's a trip service you want to do traveling salesman type stuff you will even spit back matte box vector tiles which is crazy to me it has its route and the API is really very well thought out you can do really anything you need to do with at least I think of so that response will look something like this and by default the geometry comes back as a weird route service it comes back as this polyline format which is like this encoded coordinate system I guess Google uses it just looks weird so I'm having it spit that back out straight as a Gio Jason pod format is much more compact but I have to convert it to geo Jason on the client in anyway so who cares and it spits back all this stuff I've requested all throughout steps so it's a very long response but this is a route between two coordinates I picked at random in Mecklenburg County and you can see one thing to note is that the size of the data that you use is directly correlated to the amount of RAM that this docker image is going to take up so it's uh you got to be aware of that I the first time I ran it I did like my my complete area I do for my vector tiling which includes Mecklenburg County and all of this other stuff just for background and that was like about 600 Meg's a ram it was taking just loading those files that made into memory which is still nothing but if you count like a 1 gig of ram digitalocean droplet well start to worry about that guy stuff so I chopped to Mecklenburg County out to an area around so a lot tighter and now it's doing around 160 megabytes which is a little bit friendlier so I'm going to keep in mind if you want to deploy this on a really tiny server someplace but it's it's nut it barely hits the CPU when you you throw things at it it's it's awesome I made this little demo site until I put a lot of effort into this and it is just to see how this might work and integrate with with one of our websites and the OS are up folks very kindly have a see there's a link to it somewhere if I can't find it I had looked at PG routing for for routing within post just and it's really cool but they don't have a natural language route description like turn left here turn right there they I look down there the wiki and they they have some good reasons for not having that that's very language and locale dependent but they're you know you'd have to find something someone had done for that or right one of those yourself this they have a or SRM text instructions thing you can include in JavaScript and you can give it a language I'm not sure what all languages it supports but it will give natural language routing information back to you so it'll say turn left here turn right there so on this little demo I cooked up here I'm just giving it two coordinates and say make a route see it's made this route you can see it's it's like instant here's the route it made and I just had it one of you hover along here I didn't put a lot of effort into this it will show you where that particular thing and you'll see its head southwest turn right here turn left of there go straight you know it's pretty cool I also did a traveling salesman traveling salesman they let you really the the api's are really smart by default it's a round trip from the starting point but you can have set specific starting points and ending points it's just taking four random locations I picked and it made a traveling salesman solution you can see all the directions here to get from one place to the other yeah that is really awesome and so this took me once I got my PDF file ten minutes to set up and a good bit longer screwing around of this because I decided to try spelt which is really cool but it's it's quite different then then view or react spelt is a reactive framework that essentially goes away it's not a tool that ships down to your client it is a transpiler so Savelle to your client never gets a savant library like it whitter for react review or pre-act spell it just kind of goes away when you when you build your code so it makes really tiny fast code doesn't use virtual Dom it's it's really interesting so I started to play around that which made this take a lot longer than it might have otherwise but it's it's fairly basic I just have a spell tap not bigger there no bigger bigger bigger there we go I just have this felt app and it's just a couple of components spelt has a built in a central storage kind of like view X where you can set some things for for your your app to share and watch you do a little bit differently when you watch stuff you do one of these guys which isn't really JavaScript it's like a Savelle thing which is the only thing that's spelt it isn't really JavaScript and I find that slightly irritating but it works fine so what I'm saying here is this step long lap if you're hovering over a a step do you call this show step function this show step function just puts it on the map essentially so there's there's not a whole lot of code here at all the route is doing a fetch and it's sending some coordinates to this docker container that's running and when it gets back this route was point-to-point in route it sends the coordinates from the from the Jason return off to draw that line and then for each leg it's using this OS or on text instructions to take what it's sending back which is not turn right turn left that guy stuff and it's translating it into that so you can make those nice kind of directions and that's all I want to say this it's really cool and again everybody probably knows about OS RM but I'm not really a rounding kind of person but if I have a routing need this is probably what I'm going to use it seems to be it's extremely fast it's little resources assuming you're using a smaller area and it is has its own API built in and I can't get it to do anything wrong it's just rolls right along it's got some options to build networking optimized for say walking or biking this is using Open Street Map data so in the Charlotte area Open Street Map data is it's quite frankly better than our data in most cases especially for something like work like this but if you're in an area that doesn't have great awesome coverage first you know it's it's an open open dataset you should put that date in but if you don't have time for that and then this might not be the best solution for you but if you're looking for general OpenStreetMap based routing OSR is really great and really easy and the documentation is also fantastic okay I just wanted to share that with you I'll talk to you later bye-bye
Info
Channel: Tobin Bradley
Views: 5,167
Rating: 4.9298244 out of 5
Keywords: routing, svelte
Id: F_yJbENAvg8
Channel Id: undefined
Length: 13min 37sec (817 seconds)
Published: Mon Sep 23 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.