[OSM-dev] How to get the order of bus stops in a bus route?
Dear all, I would like to get the bus stops in order in a route for bus transit service ,including the bus route starting point and end point(bus station or terminus). Can anybody provide any ideas on how to achieve it? Thanks in advance. Regards, Shuyan ___ dev mailing list dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/dev
Re: [OSM-dev] How to get the order of bus stops in a bus route?
Hi, I am designing aloud, what do you think of this : i) 1 bus stop = 1 node ii) 1 bus route from origin to destination = 1 relation containing : the origin-destination route way + the bus stops nodes for this route ; those stops may be a nodes of route way or nodes not contained in the route way but close by enough. Are there already any similar or different implementations of i) / ii) on osm.org data ? For ii) to work in path find algorithms, the latter should assume that an ii) node separate from the route that's being considered, can be replaced by the ii) node closest to the former separate ii) node. For example, if we just want to display a polyline / sub-way of BR route from A to B... ...here's one idea for a very simple use case where a user wants to go from bus stop A to bus stop B, A B on a same bus route BR. 1) starting node is A, destination node is B, directions steps is empty append A to directions nodes append B to directions nodes 2) directions finding, every following appending equals appending [A, [here,...] ,B], without touching A and B : if A is not part of BR's way, then make the directions finding algorithm origin point be the closest node to A on BR way that is also closest in route distance to B; end if same for B, make algorithm's destination point be the closest node to B on BR way that is also closest in route distance to A 3) run directions algorithm's and append nodes if any.. calculate estimate travel duration 4) display polyline / way made up of [A,...intermediate nodes..,B] Jonathan 2010/2/10 Shuyan Chen chenshuyan0...@hotmail.com Dear all, I would like to get the bus stops in order in a route for bus transit service ,including the bus route starting point and end point(bus station or terminus). Can anybody provide any ideas on how to achieve it? Thanks in advance. Regards, Shuyan ___ dev mailing list dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/dev ___ dev mailing list dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/dev
Re: [OSM-dev] How to get the order of bus stops in a bus route?
Hi, Jonathan Thanks for your comments. i) 1 bus stop = 1 node ii) 1 bus route from origin to destination = 1 relation containing : the origin-destination route way + the bus stops nodes for this route ; those stops may be a nodes of route way or nodes not contained in the route way but close by enough. Are there already any similar or different implementations of i) / ii) on osm.org data ? I just want to find a way to get ii) for a bus route in relations to implement path find algorithm. Regards, Shuyan From: Jonathan-David SCHRODER Sent: Wednesday, February 10, 2010 1:52 PM To: Shuyan Chen Cc: dev@openstreetmap.org Subject: Re: [OSM-dev] How to get the order of bus stops in a bus route? Hi, I am designing aloud, what do you think of this : i) 1 bus stop = 1 node ii) 1 bus route from origin to destination = 1 relation containing : the origin-destination route way + the bus stops nodes for this route ; those stops may be a nodes of route way or nodes not contained in the route way but close by enough. Are there already any similar or different implementations of i) / ii) on osm.org data ? For ii) to work in path find algorithms, the latter should assume that an ii) node separate from the route that's being considered, can be replaced by the ii) node closest to the former separate ii) node. For example, if we just want to display a polyline / sub-way of BR route from A to B... ...here's one idea for a very simple use case where a user wants to go from bus stop A to bus stop B, A B on a same bus route BR. 1) starting node is A, destination node is B, directions steps is empty append A to directions nodes append B to directions nodes 2) directions finding, every following appending equals appending [A, [here,...] ,B], without touching A and B : if A is not part of BR's way, then make the directions finding algorithm origin point be the closest node to A on BR way that is also closest in route distance to B; end if same for B, make algorithm's destination point be the closest node to B on BR way that is also closest in route distance to A 3) run directions algorithm's and append nodes if any.. calculate estimate travel duration 4) display polyline / way made up of [A,...intermediate nodes..,B] Jonathan 2010/2/10 Shuyan Chen chenshuyan0...@hotmail.com Dear all, I would like to get the bus stops in order in a route for bus transit service ,including the bus route starting point and end point(bus station or terminus). Can anybody provide any ideas on how to achieve it? Thanks in advance. Regards, Shuyan ___ dev mailing list dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/dev Emoticon1.gif___ dev mailing list dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/dev
Re: [OSM-dev] How to get the order of bus stops in a bus route?
Hi, I don't know more about the tagging names. You should find ii) in big cities. Use http://wiki.openstreetmap.org/wiki/Bus and http://osmdoc.com/en/tags/ Jonathan On Wed, Feb 10, 2010 at 2:04 PM, Shuyan Chen chenshuyan0...@hotmail.comwrote: Hi, Jonathan Thanks for your comments. i) 1 bus stop = 1 node ii) 1 bus route from origin to destination = 1 relation containing : the origin-destination route way + the bus stops nodes for this route ; those stops may be a nodes of route way or nodes not contained in the route way but close by enough. Are there already any similar or different implementations of i) / ii) on osm.org data ? I just want to find a way to get ii) for a bus route in relations to implement path find algorithm.[image: Smile emoticon] Regards, Shuyan *From:* Jonathan-David SCHRODER jonathan.schro...@gmail.com *Sent:* Wednesday, February 10, 2010 1:52 PM *To:* Shuyan Chen chenshuyan0...@hotmail.com *Cc:* dev@openstreetmap.org *Subject:* Re: [OSM-dev] How to get the order of bus stops in a bus route? Hi, I am designing aloud, what do you think of this : i) 1 bus stop = 1 node ii) 1 bus route from origin to destination = 1 relation containing : the origin-destination route way + the bus stops nodes for this route ; those stops may be a nodes of route way or nodes not contained in the route way but close by enough. Are there already any similar or different implementations of i) / ii) on osm.org data ? For ii) to work in path find algorithms, the latter should assume that an ii) node separate from the route that's being considered, can be replaced by the ii) node closest to the former separate ii) node. For example, if we just want to display a polyline / sub-way of BR route from A to B... ...here's one idea for a very simple use case where a user wants to go from bus stop A to bus stop B, A B on a same bus route BR. 1) starting node is A, destination node is B, directions steps is empty append A to directions nodes append B to directions nodes 2) directions finding, every following appending equals appending [A, [here,...] ,B], without touching A and B : if A is not part of BR's way, then make the directions finding algorithm origin point be the closest node to A on BR way that is also closest in route distance to B; end if same for B, make algorithm's destination point be the closest node to B on BR way that is also closest in route distance to A 3) run directions algorithm's and append nodes if any.. calculate estimate travel duration 4) display polyline / way made up of [A,...intermediate nodes..,B] Jonathan 2010/2/10 Shuyan Chen chenshuyan0...@hotmail.com Dear all, I would like to get the bus stops in order in a route for bus transit service ,including the bus route starting point and end point(bus station or terminus). Can anybody provide any ideas on how to achieve it? Thanks in advance. Regards, Shuyan ___ dev mailing list dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/dev Emoticon1.gif___ dev mailing list dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/dev
Re: [OSM-dev] How to get the order of bus stops in a bus route?
Hi Shuyan, see also http://wiki.openstreetmap.org/wiki/Relation:route and instead of implementing your own pathfinding algorithm, take a look first at http://wiki.openstreetmap.org/wiki/Traveling_salesman = OSMNavigation, the path finding library used by Traveling Salesman ( a frontend).. the library relies on libOsm for querying osm data. if OSMNavigation doesn't satisfies you because you can't hack it your way easily, then implement your own stuff.. but try not reinventing the wheel, if you can be lazy and program less and duplicate less that's cool Take care, Jonathan On Wed, Feb 10, 2010 at 2:13 PM, Jonathan-David SCHRODER jonathan.schro...@gmail.com wrote: Hi, I don't know more about the tagging names. You should find ii) in big cities. Use http://wiki.openstreetmap.org/wiki/Bus and http://osmdoc.com/en/tags/ Jonathan On Wed, Feb 10, 2010 at 2:04 PM, Shuyan Chen chenshuyan0...@hotmail.comwrote: Hi, Jonathan Thanks for your comments. i) 1 bus stop = 1 node ii) 1 bus route from origin to destination = 1 relation containing : the origin-destination route way + the bus stops nodes for this route ; those stops may be a nodes of route way or nodes not contained in the route way but close by enough. Are there already any similar or different implementations of i) / ii) on osm.org data ? I just want to find a way to get ii) for a bus route in relations to implement path find algorithm.[image: Smile emoticon] Regards, Shuyan *From:* Jonathan-David SCHRODER jonathan.schro...@gmail.com *Sent:* Wednesday, February 10, 2010 1:52 PM *To:* Shuyan Chen chenshuyan0...@hotmail.com *Cc:* dev@openstreetmap.org *Subject:* Re: [OSM-dev] How to get the order of bus stops in a bus route? Hi, I am designing aloud, what do you think of this : i) 1 bus stop = 1 node ii) 1 bus route from origin to destination = 1 relation containing : the origin-destination route way + the bus stops nodes for this route ; those stops may be a nodes of route way or nodes not contained in the route way but close by enough. Are there already any similar or different implementations of i) / ii) on osm.org data ? For ii) to work in path find algorithms, the latter should assume that an ii) node separate from the route that's being considered, can be replaced by the ii) node closest to the former separate ii) node. For example, if we just want to display a polyline / sub-way of BR route from A to B... ...here's one idea for a very simple use case where a user wants to go from bus stop A to bus stop B, A B on a same bus route BR. 1) starting node is A, destination node is B, directions steps is empty append A to directions nodes append B to directions nodes 2) directions finding, every following appending equals appending [A, [here,...] ,B], without touching A and B : if A is not part of BR's way, then make the directions finding algorithm origin point be the closest node to A on BR way that is also closest in route distance to B; end if same for B, make algorithm's destination point be the closest node to B on BR way that is also closest in route distance to A 3) run directions algorithm's and append nodes if any.. calculate estimate travel duration 4) display polyline / way made up of [A,...intermediate nodes..,B] Jonathan 2010/2/10 Shuyan Chen chenshuyan0...@hotmail.com Dear all, I would like to get the bus stops in order in a route for bus transit service ,including the bus route starting point and end point(bus station or terminus). Can anybody provide any ideas on how to achieve it? Thanks in advance. Regards, Shuyan ___ dev mailing list dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/dev Emoticon1.gif___ dev mailing list dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/dev
Re: [OSM-dev] How to get the order of bus stops in a bus route?
Hi,Jonathan Many thanks for all of these. We have our own osm-based routing website, take a look at http://www.fromtomap.com/. Thank you very much. Regards, Shuyan From: Jonathan-David SCHRODER Sent: Wednesday, February 10, 2010 2:21 PM To: Shuyan Chen Cc: dev@openstreetmap.org Subject: Re: [OSM-dev] How to get the order of bus stops in a bus route? Hi Shuyan, see also http://wiki.openstreetmap.org/wiki/Relation:route and instead of implementing your own pathfinding algorithm, take a look first at http://wiki.openstreetmap.org/wiki/Traveling_salesman = OSMNavigation, the path finding library used by Traveling Salesman ( a frontend).. the library relies on libOsm for querying osm data. if OSMNavigation doesn't satisfies you because you can't hack it your way easily, then implement your own stuff.. but try not reinventing the wheel, if you can be lazy and program less and duplicate less that's cool Take care, Jonathan On Wed, Feb 10, 2010 at 2:13 PM, Jonathan-David SCHRODER jonathan.schro...@gmail.com wrote: Hi, I don't know more about the tagging names. You should find ii) in big cities. Use http://wiki.openstreetmap.org/wiki/Bus and http://osmdoc.com/en/tags/ Jonathan On Wed, Feb 10, 2010 at 2:04 PM, Shuyan Chen chenshuyan0...@hotmail.com wrote: Hi, Jonathan Thanks for your comments. i) 1 bus stop = 1 node ii) 1 bus route from origin to destination = 1 relation containing : the origin-destination route way + the bus stops nodes for this route ; those stops may be a nodes of route way or nodes not contained in the route way but close by enough. Are there already any similar or different implementations of i) / ii) on osm.org data ? I just want to find a way to get ii) for a bus route in relations to implement path find algorithm. Regards, Shuyan From: Jonathan-David SCHRODER Sent: Wednesday, February 10, 2010 1:52 PM To: Shuyan Chen Cc: dev@openstreetmap.org Subject: Re: [OSM-dev] How to get the order of bus stops in a bus route? Hi, I am designing aloud, what do you think of this : i) 1 bus stop = 1 node ii) 1 bus route from origin to destination = 1 relation containing : the origin-destination route way + the bus stops nodes for this route ; those stops may be a nodes of route way or nodes not contained in the route way but close by enough. Are there already any similar or different implementations of i) / ii) on osm.org data ? For ii) to work in path find algorithms, the latter should assume that an ii) node separate from the route that's being considered, can be replaced by the ii) node closest to the former separate ii) node. For example, if we just want to display a polyline / sub-way of BR route from A to B... ...here's one idea for a very simple use case where a user wants to go from bus stop A to bus stop B, A B on a same bus route BR. 1) starting node is A, destination node is B, directions steps is empty append A to directions nodes append B to directions nodes 2) directions finding, every following appending equals appending [A, [here,...] ,B], without touching A and B : if A is not part of BR's way, then make the directions finding algorithm origin point be the closest node to A on BR way that is also closest in route distance to B; end if same for B, make algorithm's destination point be the closest node to B on BR way that is also closest in route distance to A 3) run directions algorithm's and append nodes if any.. calculate estimate travel duration 4) display polyline / way made up of [A,...intermediate nodes..,B] Jonathan 2010/2/10 Shuyan Chen chenshuyan0...@hotmail.com Dear all, I would like to get the bus stops in order in a route for bus transit service ,including the bus route starting point and end point(bus station or terminus). Can anybody provide any ideas on how to achieve it? Thanks in advance. Regards, Shuyan ___ dev mailing list dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/dev Emoticon1.gif___ dev mailing list dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/dev
Re: [OSM-dev] How to get the order of bus stops in a bus route?
Look up the GTFS feed for the city you're working on. It's a simple csv-based data feed describing a transit agency, its stops, and its schedules. If the local agency hasn't published a GTFS feed, ask them to real nice-like. That works surprisingly well. B On Feb 10, 2010 5:31 AM, Shuyan Chen chenshuyan0...@hotmail.com wrote: Hi,Jonathan Many thanks for all of these. We have our own osm-based routing website, take a look at http://www.fromtomap.com/. Thank you very much. Regards, Shuyan *From:* Jonathan-David SCHRODER jonathan.schro...@gmail.com *Sent:* Wednesday, February 10, 2010 2:21 PM To: Shuyan Chen Cc: dev@openstreetmap.org Subject: Re: [OSM-dev] How to get the order of bus stops ... Hi Shuyan, see also http://wiki.openstreetmap.org/wiki/Relation:route and instead of implementing... ___ dev mailing list dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/dev ___ dev mailing list dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/dev
[OSM-dev] Finding closet node for PyrouteLib?
Hello all! I'm new to OSM and am glad to be a part of the community! I posted the following question on the newbies thread and was told to post it here instead. I have an application that has many addresses that I have geocoded. I am trying to use Pyroutelib (see here: http://wiki.openstreetmap.org/wiki/PyrouteLib) to find routing distances from one address to another. It seems that the library does not accept lat/lon (from the addresses I geocoded) as an input and only does node to node routing. I thought I should then try to find the closet node to my lat/lon position for my address, then send that node in to Pyroutelib for routing. Any suggestions as to how to do this? Is there something simple that I haven't thought of? Thanks all! Tareq ___ dev mailing list dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/dev
Re: [OSM-dev] Finding closet node for PyrouteLib?
The data object in that routing module should have a findNode() function that gives the nearest routable node for your chosen transport type. This function is located in loadOsm.py (don't just choose the nearest OSM node since that might be a county boundary or something - the findNode function returns the nearest node which is on a path that you can travel) On Wed, Feb 10, 2010 at 9:30 PM, Tareq Ismail hellothereta...@gmail.com wrote: Hello all! I'm new to OSM and am glad to be a part of the community! I posted the following question on the newbies thread and was told to post it here instead. I have an application that has many addresses that I have geocoded. I am trying to use Pyroutelib (see here: http://wiki.openstreetmap.org/wiki/PyrouteLib) to find routing distances from one address to another. It seems that the library does not accept lat/lon (from the addresses I geocoded) as an input and only does node to node routing. I thought I should then try to find the closet node to my lat/lon position for my address, then send that node in to Pyroutelib for routing. Any suggestions as to how to do this? Is there something simple that I haven't thought of? Thanks all! Tareq ___ dev mailing list dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/dev ___ dev mailing list dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/dev
Re: [OSM-dev] Finding closet node for PyrouteLib?
Thanks OJ! That has solved my issue, you're wonderful. I'm going to change how pyroutelib works so that it also accepts lat/lon in addition to nodes. If I wanted to contribute my code to pyroute lib, how would I do so? Do you think it would be useful enough to contribute? Tareq On Wed, Feb 10, 2010 at 2:18 PM, OJ W ojwli...@googlemail.com wrote: The data object in that routing module should have a findNode() function that gives the nearest routable node for your chosen transport type. This function is located in loadOsm.py (don't just choose the nearest OSM node since that might be a county boundary or something - the findNode function returns the nearest node which is on a path that you can travel) On Wed, Feb 10, 2010 at 9:30 PM, Tareq Ismail hellothereta...@gmail.com wrote: Hello all! I'm new to OSM and am glad to be a part of the community! I posted the following question on the newbies thread and was told to post it here instead. I have an application that has many addresses that I have geocoded. I am trying to use Pyroutelib (see here: http://wiki.openstreetmap.org/wiki/PyrouteLib) to find routing distances from one address to another. It seems that the library does not accept lat/lon (from the addresses I geocoded) as an input and only does node to node routing. I thought I should then try to find the closet node to my lat/lon position for my address, then send that node in to Pyroutelib for routing. Any suggestions as to how to do this? Is there something simple that I haven't thought of? Thanks all! Tareq ___ dev mailing list dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/dev ___ dev mailing list dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/dev