pgRouting

Forum #22 - Topic #33 - Message List

fastest path

hi list,

I'm newbie in this network routing, it's very interesting, exclusively with real road network, but I have some problem : 1. How to use shortest path function as fastest path function, or there is another way to find fastest path function?. 2. How to create App that let user click on map as "start" and "end" node, Because I read comment on the create function that this issue is threat by "point_to_id" function. How?, Does anybody have that sample?, Please post it in this forum. 3. The sample app doesn't have "Shortest Path using Shooting*" page (ssp.phtml)?.

Thanks,

Regards,

Ari Sutanto

  • Message #116

    Hi Ari,

    1. All you need is a column with speed value (maximum or average). Nowing both speed and length you can calculate how much time it takes to pass an edge, right? So, you can use this time value as a cost for any shortest path algorithm. And even more! For example, you want to prefer broad roads and avoid narrow ones. If you have a column with number of lanes, you can, for example, divide your cost (time) value by the number of lanes and shortest path algorithm will prefer to go along broad roads.

    2. Look here - http://demo.orkney.jp/ipax/

    You need to pass x and y to PostGIS ant that you can find nearest vertex or edge using distance() function.

    3. No, we are still debugging this algorithm. Right now we have problems with memory. The current version of pgRouting is 1.0.0a which means that it is at alfa stage now. You can try to use it, but we do not guarantee stable work.

  • Message #117

    Ari,

    That's me again.

    Have you seen http://demo.orkney.jp/routing/phtmls/ssp.phtml ?

    I can send it to your email if you want it.

    • Message #118

      Hi anton,

      for problem: 1. Yes, I'll try it out. 2,3. The demo is exactly what I want, Can send to me that source sample app.

      Yes please send me the file, Thanks.

      Regards,

      Ari Sutanto

      • Message #119

        Ari,

        Which demo is it exactly what you want?
        1) http://demo.orkney.jp/ipax/ or
        2) http://demo.orkney.jp/routing/phtmls/ssp.phtml

        Where do you have the problem getting start end end point?
        1) The map interface, so then you might want to know how to add click events with Javascript for example and retrieve the coordinates, or
        2) How to find the closest vertex/edge from the point you clicked. That would be a PostGIS question then.

        • Message #120

          Hi anton,

          1. Yes I want both of them,thank's.

          2. Yes, I want to know,how to add click events with Javascript for example and retrieve the coordinates.

          3. I have tried in first problems,about fastest path. I have data drive time (in minute) every edge/vertex which I make value cost at algorithm a* to look for fastest distance. In sql :

          $sql="the_geom from ( select gid, the_geom from "." shortest_path_astar2_as_geometry_internal_id_directed('tercepat ". $start.", ". $end.", ". $ll_x.", ". $ll_y.", ". $ur_x.", ". $ur_y.", false, true)) as g using unique gid using SRID=-1";

          notes: tercepat as view:

          (CREATE OR REPLACE VIEW tercepat AS

          SELECT jln_jogja.gid, jln_jogja.the_geom, jln_jogja.x1, jln_jogja.y1, jln_jogja.x2, jln_jogja.y2, jln_jogja.source::integer AS source, jln_jogja.target::integer AS target, jln_jogja.kecp_ft AS length, jln_jogja.kecp_ft::double precision AS cost, jln_jogja.kecp_tf::double precision AS reverse_cost

          FROM jln_jogja;)

          But the result of this still less suitable, how ought?

          4. There is a question again, how making time data traffic light or turn time if in algorithm shooting star?

          Thanks,

          Regards,

          Ari Sutanto

          • Message #121

            A quick answer for 1) and 2):

            For Javascript and click events there are more than enough examples available. Just google for it. You could use a framework like jQuery for example.

            The IPAX demo doesn't have very nice looking code. But you can see how it works, when you let your browser show you the source code. Just use a tool like "Firebug".

            to 4): maybe you want to look here: ShootingStar

            • Message #122

              daniel, i have tried your sugestion but i can't see the sql function on that 2 url, please give that sample file (http://demo.orkney.jp/ipax/ and http://demo.orkney.jp/routing/phtmls/ssp.phtml).

              thank's

              ari sutanto

              • Message #123

                An email should be sent to you. (This board unfortunately doesn't allow attachments.

                • Message #124

                  this is my email addres:

                  arisutanto_jogja@yahoo.co.id

                  Regards,

                  ari sutanto

                  • Message #125

                    Didn't you receive anything?

                    • Message #126

                      Yes, I didn't receive anything. Please send to my another mail address : ilham.adi@gmail.com

                      Regards,

                      ari sutanto

                • Message #127

                  Hi Anton,

                  could you please send me the sample app (ipax) as well? I would apreciate it a lot!

                  ioish AT bol DOT com DOT br

                  • Message #128

                    You know, this IPAX demo is SO messy :(

                    Please, wait for a next week - I will review all parts of that application and send it to you and Ari.

                    Sorry guys, I'm quite busy know.

                  • Message #140

                    The IPAX demo code cleanup would take too much time at the moment, which I don't have.

                    In September I will hold a workshop on the FOSS4G2007 conference about pgRouting with OpenLayers. I will place that workshop with code examples on this site once it is prepared and announce it then in this forum.

                    I think, that this will be more helpful than the IPAX example. Hope, you can wait till then.

                    • Message #143

                      Hi Anton,

                      that's ok, thanks for trying anyway :)

                      I have another question regarding sample apps and stuff, but I'll open another topic for this.