We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Introducing Wayfarer - a Python Routing Library

00:00

Formal Metadata

Title
Introducing Wayfarer - a Python Routing Library
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
Publisher
Release Date
Language
Production Year2022

Content Metadata

Subject Area
Genre
Abstract
Compass Informatics [1] is pleased to announce the open sourcing of its routing library Wayfarer [2][3]. Wayfarer is a pure Python library that allows spatial features to be loaded into a NetworkX [4] network format. Once in this format the data can be manipulated and analysed using the huge range of graph algorithms in NetworkX. The Wayfarer library provides a number of helper functions for example to calculate routes, split edges, find ends of paths, and retrieve features by keys. The talk will outline the use cases for the library, and when it may be suitable to use rather than alternatives such as pgRouting. Case studies will be presented including Wayfarer’s use in Ireland's Pavement Management System to help designate works and surveys on the road network. Wayfarer is also currently used for an Environmental Protection Agency project to create fully connected river networks in Ireland. [1] compass.ie/ [2] pypi.org/project/wayfarer/
Keywords
202
Thumbnail
1:16:05
226
242
Compass (drafting)NeuroinformatikGraph (mathematics)Source codeData structureBuildingComputer networkPattern languageRoutingAlgorithmOpen sourceGraph (mathematics)DatabasePrice indexMathematical analysisQuicksortImplementationElectronic mailing listStructural loadTwitterSource codeSoftwareComputer fileShape (magazine)JSONXMLUMLComputer animation
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
Office suiteData managementDifferent (Kate Ryan album)Computer networkCASE <Informatik>Data dictionaryOpen setMatching (graph theory)Source codeLevel (video gaming)Database
Projective planeOpen sourceCodeUML
Transcript: English(auto-generated)
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
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.
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.
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
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.
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,
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
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
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.
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,
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.