osm node data for node based pathfinding


I’m a student interaction design, along with 2 other students we are working on a offline route planner for venice.
We want to do this based on node based pathfinding in the simplest way, just for walking, which makes thing a lot more simple (you dont have to take into account the speed limit for example).
We have a basic sketch for node based path finding already working.

A good next step will be to get all the nodes of venice with the edge information.
The more i look into it the more confused i get.

Is it possible to get this data with osm?
And if so, where do i have to look and how does the data look like?

I would really appreciate if someone could provide some info, we are more designers/artists then computer engineers/programmers, despite that we are not bad at programming either.


Spatialite tools come with spatialite_osm_net tool which is building a graph directly from OSM data file. Read more from https://www.gaia-gis.it/fossil/spatialite-tools/wiki?name=OSM+tools

Yes, it is possible to get that data with OSM.

You can either try to understand OSM data starting with the basics

  • Understand the OSM data model (maybe start here)

  • Get yourself an OSM data parsing library (availability depends on your programming language / platform)

  • Download an extract of the region you are interested in, e.g. from http://downloads.cloudmade.com/europe/southern_europe/italy

  • Extract the graph structure using self-written code

or you can try to find a tool that abstracts some parts of this process away from you. (I believe the Spatialite OSM tool falls into that category - can’t comment on that, though, as I’ve never used it myself.)


I just tried it and I can recommend to do the same. I imported finland.osm.pbf into a new Spatialite database with spatialite_osm_net. It took about 5 minutes with a pretty modern laptop with 4 core processor. After that I opened the new database with Spatialite-GUI 1.6.0 and created a virtual network with the “Build network” button. It took under a minute. Now I can run routing queries as

select * from way_net
where NodeFrom=169347
and NodeTo=429902

Routing is fast, 0.8 second for finding a 600 km long route with 850 member ways. I have not checked the quality of routing. However, system is fast and pretty simple to use. It should not take very much work to create user interface for taking the NodeFrom and NodeTo values from a map.

I suppose that this blog posting is still mostly valid

Keep in mind that the OP has specific requirements, though: Pedestrian routing for Venice. This means that performance isn’t a big concern because of the small amount of data. To judge the suitability of a given tool, it would seem more important whether it can be configured to filter ways for pedestrian accessibility. Can they do this with your suggested approach?

There is coast column that is used by the virtual network
Update the value to something very high value for non-pedestrian ways and it should work.

In general, see http://wiki.openstreetmap.org/wiki/Routing

I added a line about Spatialite into that wiki page.
A also found a couple of years old comprehensive tutorial about doing routing with OSM data and Spatialite tools and utilities.

Right, Venice is full of canals which will show up if you don’t filter them out.

I take it the route planner should be suited for tourists? From my own experience, there is a lot of traffic going by watertaxis. Wouldn’t you want to take that into account?