[OSM-dev] Spatial road network data sets and implementation using API

Andrew Byrd andrew at fastmail.net
Tue Mar 28 07:29:51 UTC 2017


> On 28 Mar 2017, at 15:16, Debajyoti Ghosh <4u.debajyoti at gmail.com> wrote:
> 1] Can u specifically refer a site for data where from i can dwnld & visualize in triplet <start node, end node, distance> format and n POIs is <latitude, longitude format>? In which editor i'll be able to see ?

OpenStreetMap data is good for this purpose. Many people provide extracts of OpenStreetMap data for specific geographic regions, for example: https://mapzen.com/data/metro-extracts/ <https://mapzen.com/data/metro-extracts/>

But OSM data is essentially a huge list of points (nodes) and ways formed by connecting those nodes in a certain sequence. It needs to be converted to a graph if you want to apply graph algorithms, and generally you’ll want to treat the nodes that intersections differently than those that only contribute to the shape and length of the edges between the intersections. 

I don’t know of any source for just converting to a routable graph and listing the edge tuples, but again by using an existing routing system you will have that information in data structures in memory. To cite the system I’m most familiar with (OpenTripPlanner) if you load some OSM data, you’ll end up with a Graph object:
https://github.com/opentripplanner/OpenTripPlanner/blob/master/src/main/java/org/opentripplanner/routing/graph/Graph.java <https://github.com/opentripplanner/OpenTripPlanner/blob/master/src/main/java/org/opentripplanner/routing/graph/Graph.java>

which then contains a lot of Vertex and Edge objects, for example in the fields vertices and edgeById. You could write whatever code you want to dump those out as tuples or route on them.

Andrew

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20170328/29c373ae/attachment.html>


More information about the dev mailing list