Introducing Wayfarer - a Python Routing Library
This is a modal window.
The media could not be loaded, either because the server or network failed or because the format is not supported.
Formal Metadata
Title |
| |
Title of Series | ||
Number of Parts | 351 | |
Author | ||
License | CC Attribution 3.0 Unported: You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor. | |
Identifiers | 10.5446/68982 (DOI) | |
Publisher | ||
Release Date | ||
Language | ||
Production Year | 2022 |
Content Metadata
Subject Area | ||
Genre | ||
Abstract |
| |
Keywords |
FOSS4G Firenze 2022260 / 351
1
7
13
22
25
31
33
36
39
41
43
44
46
52
53
55
58
59
60
76
80
93
98
104
108
127
128
133
135
141
142
143
150
151
168
173
176
178
190
196
200
201
202
204
211
219
225
226
236
242
251
258
263
270
284
285
292
00:00
Compass (drafting)NeuroinformatikGraph (mathematics)Source codeData structureBuildingComputer networkPattern languageRoutingAlgorithmOpen sourceGraph (mathematics)DatabasePrice indexMathematical analysisQuicksortImplementationElectronic mailing listStructural loadTwitterSource codeSoftwareComputer fileShape (magazine)JSONXMLUMLComputer animation
01:48
Network-attached storageStandard errorPolygonVertex (graph theory)File formatFront and back endsComputer networkStreaming mediaOrder (biology)Mathematical analysisVapor barrierLevel (video gaming)Term (mathematics)Point (geometry)Graph (mathematics)Computer animation
02:43
Office suiteData managementDifferent (Kate Ryan album)Computer networkCASE <Informatik>Data dictionaryOpen setMatching (graph theory)Source codeLevel (video gaming)Database
03:15
Projective planeOpen sourceCodeUML
Transcript: English(auto-generated)
00:01
Hi everyone. So yeah, my name's Seth and I'm gonna give a quick introduction on Wayfarer. So it's a Python routing library and it's based on NetworkX. So if anyone's worked with NetworkX before, it's built on top of that and it adds geospatial routing functionality on top. So this isn't a new idea, there's quite a few kind of implementations
00:21
but I've been using this for about seven or eight years and this year we finally were able to make it open source. So it works with graphs, which collections of nodes and edges. So several of the talks this morning have been about graphs and routing. So it's kind of the same concept. And the idea is to create a nice simple API in Python.
00:41
So you can load data from any source, so any database. So in this example here, it's using Fiona, which can load anything that GDAL can work with. So as opposed to pgRouting, where you have to have a postgis, postgres database, this you can work with any database or a shapefile or basically anything that GDAL can load.
01:03
And this kind of gives an indication that the API, where you can load your network, you pass in two nodes and you get a list of edges back. So that's kind of the basic concept. So yeah, the main reason is that you can use any data source, you're not limited to a specific database
01:20
and it builds on NetworkX. So there's hundreds of algorithms already implemented. So I didn't go crazy and try and re-implement all of the routing algorithms. It builds on NetworkX, which is used for working with massive graphs. So if you imagine Twitter followers, you can kind of use that library to work out who follows who and all sorts of patterns.
01:43
So all those algorithms are then ready and available for geospatial analysis. So just in terms of what I've been using it for for the last few years, in Ireland, we've been creating river networks. So joining together all of the river segments. And once they're in a nice graph format,
02:01
you can do things like apply stream order. So in this example, it's applying the Strala stream order. So you can work out basically the size of the river from when you go from upstream to downstream. So that's been kind of one of the main uses of the library. You can also do things like solving upstream and downstream on river networks. So in this example, you can click a point on the map
02:23
and then the library at the backend will give you all the ancestor edges. So basically you can find everything upstream, which has quite a few applications such as finding where salmon can swim upstream. If there's barriers, you can put them in, you can work out, basically you can open up your river networks
02:40
for salmon fishing and farming. And we've also used it for road networks in Ireland. So we've had kind of road networks from different sources. So there's open street map, then Ireland has its own database. And basically we're trying to match different roads from kind of old networks to new networks.
03:01
So the library is very useful. Again, as it's all in Python, you have access to the data. Everything comes in as kind of a Python dictionary. So you can manipulate it, work with it at a very low level. So that's the kind of two main use cases that we've been using it for. So yeah, as I say, the code's been around for seven, eight years,
03:20
but finally managed to kind of tidy up and make it an open source project. So it's available on GitHub and it's available for download on PyPI as well. And that's it. So it's just a quick introduction. So yeah, feel free to try it out and yeah, you can contact me for any questions or any problems. Great, thank you.