[GraphHopper] How to ­­­consider traffic jam wh­e­n­ route on road netwo

lanmaster at hotmail.ru lanmaster at hotmail.ru
Thu Jan 9 04:19:31 UTC 2014


Hello, Peter!
I understand that is possible to make changes in source code (because it opensource), but it would be very nice if we can use Graphhopper as library and extends or implements some classes/methods for our purposes (instead overwrite the Weighting). Or am i wrong?

Пнд 06 Янв 2014 17:22:46 +0500, Peter K  написал:  
  
    Hi,

      indeed: if you are updating the edges in real time you won't be
      able to use CH or you will have to prepare the graph again which
      is not real-time but okayish for country-sized data like Germany
      ( how to set this bitmask because I couldn't find any
      documentation on to flags itself.

      Yes, again as Nicolas said (thanks btw :) !) there is no
      documentation but you can see the CarFlagEncoder class and its
      unit tests. Mainly the first two bits specifies the access
      (forward?, backward?) and then the speed as integer (but with low
      resolution - only 5km/h). You should increase the resolution if
      you have very precise real time data.

      Regards,

      Peter.        
        
Hello,        
        
It could work but I think that this will get
            the routing algorithm even slower.        
        
Add this to the drop of contraction your
            performances would get really poor I’m afraid.        
        
Nicolas
            GILLET        
        
Market-IP
              –Creating
              Mobile Intelligence        
        
Phone :
            +32 81 33 11 11        
        
Fax :
            +32 81 33 11 10        
        
www.market-ip.com
            –
            www.telefleet.com
            – 
              www.geoplanning.net – www.drivexpert.net        
        
De : lanmaster at hotmail.ru
            [mailto:lanmaster at hotmail.ru]

            Envoyé : lundi 6 janvier 2014 12:17

            À : Nicolas Gillet

            Cc : GraphHopper Java routing engine; Jrgen Zornig

            Objet : Re: Re: [GraphHopper] How to ­­consider
            traffic jam whe­n­ route on road network        
        
Hello, Nicolas,

          Why do I need to change any edge's weight? 

          My thought is about make no
              change in the graph data, but parallel
          calculate my own weights and use that in algorithm-place,
          where gets original Graph's weights.

          May be my things was incorrect, please explain me.

          Пнд 06 Янв 2014 16:05:06 +0500, Nicolas Gillet 
          написал:          
          
Hello
              guys,          
          
That implementation won’t be efficient I
              think.          
          
First thing you must know about using real
              time weighting is that you won’t be able to use
              contractions hierarchies unless you re-contract the whole
              graph any time you change any edge’s weight.          
          
Without contraction you’ll have a serious
              downgrade of performances.          
          
If you still want to perform real time
              weighting, the best option is to update the edge’s weight
              with your live traffic info, so updating the flags.          
          
> 1.) Which flags are included and
              which position they are set?

            This depends on the flag encoders you use,
              check the CarFlagEncoder class.          
          
> 2.) Is there a convinient way to
              get a single EdgeIteratorState Object directly by poviding
              its ID?          
          
If you know it’s GraphHopper’s ID, you can do
              graph.getEdgeProps(edgeId, Integer.MIN_VALUE) but you’ll
              have to maintain a way to link OSM ID’s with GH’s ids.          
          
Regards,          
          
Nicolas
              GILLET          
          
Market-IP
                –Creating
                Mobile Intelligence          
          
Phone :
              +32 81 33 11 11          
          
Fax :
              +32 81 33 11 10          
          
www.market-ip.com –
              www.telefleet.com – 
                www.geoplanning.net – www.drivexpert.net          
          
De :
              lanmaster at hotmail.ru
              [mailto:lanmaster at hotmail.ru]

              Envoyé : lundi 6 janvier 2014 11:47

              À : Jrgen Zornig

              Cc : GraphHopper Java routing engine

              Objet : Re: [GraphHopper] How to ­consider traffic
              jam when­ route on road network?          
          
Hello, Jrgen!

            I think about this implementation:

            1. We have in-memory arraylist, that contains infos about
            traffic jam

            2. We have function that can calculate weight of way by two
            coordinate pairs (from node / to node)

            3. We have modification on Graphhopper's route calculate
            algorithm, that can request weight from our weight function
            (2) and summarize it with original Graphhopper's weight.

            Can that implementation be useful, how do you think?

            Пнд 06 Янв 2014 15:16:52 +0500, Jrgen Zornig  написал:            
            
I am also trying to figure out how real time graph
              modifications and short and temporary events should be
              handled for the routing.

              I assume you use to OSM graph? That makes things more
              complicated I think,because I have not found a function to
              retrieve a single Edge without iterating over and over the
              whole graph. Even when you know the Edge Id, you have to
              iterate over all Edges.

              In our scenario, we use a different (our own) graph, and
              while loading it, I build up a HashMap for all
              EdgeIteratorState Objects I have generated during loading.
              So I can easily find a corresponding Edge for a given
              TrafficJam, either by directly referencing it over our
              EdgeIds or by finding out the Id via the LocationIndex
              (NodeIds and the referenced EdgeIds).

              When having the corresponding EdgeIteratorState Object it
              should be simple to deactivate the Edge by calling
              setFlags(), but I also have no clue yet, how to set this
              bitmask because I couldn't find any documentation on to
              flags itself.

              So I want to add to this question:

              1.) Which flags are included and which position they are
              set?

              2.) Is there a convinient way to get a single
              EdgeIteratorState Object directly by poviding its ID?

              I am in need of these functions to handle real time
              traffic data on the graph.

              P.S. Perhaps we can figure it out by ourselves, so Peter
              doesn't have to answer every single question ;)

              Regards,

              Juergen

              Am 06.01.2014 09:54, schrieb 
                lanmaster at hotmail.ru:              
              
Graphhopper is a project for finding routes over a road
                network. It also provides functionality for weighting
                this routing like
                fastest
                or shortest
                path e.g. via the FastestWeighting class. Now, the
                question is: how can we extend
                Graphhopper
                to use the speed data we get from our traffic provider
                in realtime?              
              
As I can see:                
                
                  We must create a function that gets traffic jam data
                  from our database.
                
                  We must force use that modified function (Encoder?)
                  somewhere in Graphhopper 
                    route()
                  function. Do I think right?              
              
Please show me how we can do this by example.            
            
_______________________________________________            
            
GraphHopper mailing list            
            
GraphHopper at openstreetmap.org            
            
https://lists.openstreetmap.org/listinfo/graphhopper      
      
_______________________________________________
GraphHopper mailing list
GraphHopper at openstreetmap.org
https://lists.openstreetmap.org/listinfo/graphhopper
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/graphhopper/attachments/20140109/62977f8c/attachment.html>


More information about the GraphHopper mailing list