Spatial data and path finding algorithms are very much related. In this section, we are going to use a dataset representing the road network in New York, neo4j-spatial, and the GDS plugin (see Chapter 4, The Graph Data Science Library and Path Finding) to build a routing system.
The specifications for this routing application are the following:
- The user will input the start and end locations as (latitude, longitude) tuples.
- The system must return an ordered list of the streets the user needs to follow in order to go from his start to his end location by traveling the shortest distance.
Let's start by discovering and preparing the data.
Importing the data
In order to build a routing engine, we need a precise description of the road network in our area of interest. Luckily, the street network of New York is available as open data. You can find this file in the GitHub repository for this book, together with more information about its provenance...