This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

OSM routing - turning one way into an edge

0

I'm building my own routing engine - which means I'm not using any of the routing frameworks for OSM.

So far I've built a graph with edges and vertices.

I'm parsing all the ways that are highways (I'm not taking areas).

My question is: how can turn a way into an edge (with one only two nodes, one defining the start and one defining the end) and remove all the ones in the middle? What approach has developers taken with this problem?

Thank you

asked 06 Feb '15, 15:23

echoalphapapa's gravatar image

echoalphapapa
417812
accept rate: 0%

edited 06 Feb '15, 15:45

aseerel4c26's gravatar image

aseerel4c26 ♦
32.6k18248554


One Answer:

1

You could of course have a look at the existing routing engines which you don't want to use, each of which have solved that problem in one way or the other.

The question that you have been linked to in the post you reference above actually contains the answer. Re-read it: How can I convert an OSM XML file into a graph representation?

answered 06 Feb '15, 15:46

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

edited 06 Feb '15, 15:48

I was looking for an explanation that's a bit more low level.

(06 Feb '15, 15:59) echoalphapapa

Can you be more specific? Which parts are unclear to you? Where are you stuck?

(06 Feb '15, 17:06) scai ♦

Source code available on GitHub .