I have exported OpenStreetMap (OSM) data of a city to my local postgresql db using osm2pgsql.
I would like to add the General Transit Feed Specification (GTFS) routes information (say bus routes) into planet_osm_roads table as tags - say route_id(s) and agency_id(s).
All the open source GTFS tools seem to use gtfs stops as nodes. Opentripplanner, for example, does use osm street data while building the graph nodes to better understand the stops but the osm part stops right there.
I could probably iterate over all the routes, enlist all the stops in each of the trips and use routing library like PgRouting to determine the path (i.e street names) between those stops.
This seems to be a decent way, but there is no guarantee that the paths are indeed that used by the bus routes.
Any suggestions how should I be approaching this problem?