Loading data from OpenStreetMap and finding the shortest path using A*
Test data is great for understanding how algorithms work, but the real data is often more interesting. A good source for real data worldwide is OpenStreetMap (OSM), a worldwide, accessible, wiki-style, geospatial dataset. What is wonderful about using OSM in conjunction with pgRouting is that it is inherently a topological model, meaning that it follows the same kinds of rules in its construction as we do in graph traversal within pgRouting. Because of the way editing and community participation works in OSM, it is often an equally good or better data source than commercial ones and is, of course, quite compatible with our open source model.
Another great feature is that there is free and open source software to ingest OSM data and import it into a routing database—osm2pgrouting
.
Getting ready
It is recommended that you get the downloadable files from the example dataset that we have provided, available at http://www.packtpub...