I'm currently working on a project which involves tracing the path(GPS coordinates) taken by a vehicle (1) and measuring the traffic conditions(is it jammed and whats the speed during the time the vehicle was there) along the path in which the driver took (2). This is to judge whether the driver had made the appropriate actions to drive environmentally friendly and fuel efficiently during his time on route. Therefore i need 2 things. (1) A Way to Uniquely identify each road based on their direction it heads towards ( 2 or more for each road) I understand that there are OpenStreetMaps- WAY which provides me a set of nodes which will identify a road with a unique id however i am currently struggling to find the API service which can provide it to me. (2) Any traffic APi reccomendation that can provide me with historical traffic data which i can use. Cheers asked 03 Jun '15, 12:14 DillyDallyKing |
For this task I suggest to use the map matching project (where I'm the author of) With this project you can easily associate arbitrary GPS coordinates to edge IDs of GraphHopper. An edge is the connection between two junctions. And then you can use this to influence the routing of GraphHopper itself. I've blogged about the map matching here and also about the traffic influenced routing here. The problem you'll encounter is that you can get the edge IDs but not the OSM IDs and you'll have to take care when you re-import the data with fresh OSM data where the edge IDs will change. But as I've already done this several times I can say there are ways to make it working ;) For the second part of your question I only have a partial answer. We've started to collect some open/free data sources here where often e.g. only the traffic counts is available (not the flow or speed of the vehicles). Feel free to add your known sources and maybe make this more popular so that more people add their sources ;) answered 06 Jun '15, 18:54 peatar |
There is currently an open project well underway to define both an API and a matching algorithm based on OSM data here: https://github.com/opentraffic they use an approach based on osm ID and way start/end coordinates. answered 07 Jun '15, 16:10 SimonPoole ♦ |
For (1) (identifying roads), it depends on how you want to process the data. if you were to import OSM data into a PostGIS database with osm2pgsql, then you can look at the It's also possible for an OSM object to be deleted and replaced by a mapper, meaning the old id would no longer be valid and there'd be a new id. answered 08 Jun '15, 13:24 rorym |
about (1): Maybe you need something like geocoding? then see http://wiki.openstreetmap.org/wiki/Search_engines ...
or about the most used OSM APIs: http://wiki.openstreetmap.org/wiki/Xapi
or (even better!): http://wiki.openstreetmap.org/wiki/Overpass_API