<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi,<br>
<br>
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
(<10min) and good for even big cities (<2min). Updating the
already contracted graph is possible but complex and tedious.<br>
<br>
If you maintain some mapping between OSM IDs (or GPS data) and the
GraphHopper edge IDs this "update" process is easily implemented
(and should be very fast) if you overwrite the Weighting (no
changes necessary to the FlagEncoder I think) and return your own:<br>
<br>
@Override<br>
public double calcWeight( EdgeIteratorState edge ) {<br>
return getWeightForID(edge.getEdge());<br>
}<br>
<br>
<br>
> Even when you know the Edge Id, you have to iterate over all
Edges.<br>
<br>
As Nicolas pointed out there is the getEdgeProps method, but I
think extending "Weighting" should be sufficient.<br>
<br>
<br>
> how to set this bitmask because I couldn't find any
documentation on to flags itself.<br>
<br>
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.<br>
<br>
Regards,<br>
Peter.<br>
<br>
</div>
<blockquote
cite="mid:8769c270141c4805a6814f96ef53bb7e@AMSPR05MB296.eurprd05.prod.outlook.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered
medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]-->
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
code
{mso-style-priority:99;
font-family:"Courier New";}
pre
{mso-style-priority:99;
mso-style-link:"Préformaté HTML Car";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Texte de bulles Car";
margin:0cm;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
span.shorttext
{mso-style-name:short_text;}
span.hps
{mso-style-name:hps;}
span.PrformatHTMLCar
{mso-style-name:"Préformaté HTML Car";
mso-style-priority:99;
mso-style-link:"Préformaté HTML";
font-family:Consolas;
mso-fareast-language:FR-BE;}
span.EmailStyle23
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.TextedebullesCar
{mso-style-name:"Texte de bulles Car";
mso-style-priority:99;
mso-style-link:"Texte de bulles";
font-family:"Tahoma","sans-serif";
mso-fareast-language:FR-BE;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:692877314;
mso-list-template-ids:-2063299578;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hello,<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"
lang="EN-US">It could work but I think that this will get
the routing algorithm even slower.<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"
lang="EN-US">Add this to the drop of contraction your
performances would get really poor I’m afraid.<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"
lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Nicolas
GILLET<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></b></p>
<p class="MsoNormal"><b><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Market-IP
–</span></b><i><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"></span></i><i><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#404040">Creating
Mobile Intelligence</span></i><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Phone :
+32 81 33 11 11
<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Fax :
+32 81 33 11 10<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><a
moz-do-not-send="true" href="http://www.market-ip.com/">www.market-ip.com</a>
–
<a moz-do-not-send="true" href="http://www.telefleet.com/">www.telefleet.com</a>
– <a moz-do-not-send="true"
href="http://www.geoplanning.net/">
www.geoplanning.net</a> – <a moz-do-not-send="true"
href="http://www.drivexpert.net/">www.drivexpert.net</a>
<o:p></o:p></span></p>
<p class="MsoNormal"><a moz-do-not-send="true"
href="http://www.linkedin.com/groups/MarketIP-4289716?gid=4289716&trk=hb_side_g"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;text-decoration:none"><img
id="Image_x0020_1"
src="cid:part5.01060105.06040703@yahoo.de"
alt="Description : cid:image003.png@01CD5521.849F3340"
border="0" height="25" width="30"></span></a><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif""
lang="FR">De :</span></b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif""
lang="FR"> <a class="moz-txt-link-abbreviated" href="mailto:lanmaster@hotmail.ru">lanmaster@hotmail.ru</a>
[<a class="moz-txt-link-freetext" href="mailto:lanmaster@hotmail.ru">mailto:lanmaster@hotmail.ru</a>]
<br>
<b>Envoyé :</b> lundi 6 janvier 2014 12:17<br>
<b>À :</b> Nicolas Gillet<br>
<b>Cc :</b> GraphHopper Java routing engine; Jrgen Zornig<br>
<b>Objet :</b> Re: Re: [GraphHopper] How to consider
traffic jam when route on road network<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hello, Nicolas,<br>
<br>
Why do I need to change any edge's weight? <br>
<span class="hps"><span lang="EN">My thought is about make no
change </span></span>in the graph data, but parallel
calculate my own weights and use that in algorithm-place,
where gets original Graph's weights.<br>
May be my things was incorrect, please explain me.<br>
<br>
Пнд 06 Янв 2014 16:05:06 +0500, Nicolas Gillet <<a
moz-do-not-send="true"
href="mailto:nicolas.gillet@market-ip.com">nicolas.gillet@market-ip.com</a>>
написал:<o:p></o:p></p>
<div>
<p><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hello
guys,</span><o:p></o:p></p>
<p><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<p><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"
lang="EN-US">That implementation won’t be efficient I
think.</span><o:p></o:p></p>
<p><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"
lang="EN-US">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.</span><o:p></o:p></p>
<p><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"
lang="EN-US">Without contraction you’ll have a serious
downgrade of performances.</span><o:p></o:p></p>
<p><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"
lang="EN-US"> </span><o:p></o:p></p>
<p><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"
lang="EN-US">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.</span><o:p></o:p></p>
<p><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"
lang="EN-US"> </span><o:p></o:p></p>
<p><span lang="EN-US">> 1.) Which flags are included and
which position they are set?<br>
</span><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"
lang="EN-US">This depends on the flag encoders you use,
check the CarFlagEncoder class.</span><o:p></o:p></p>
<p><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"
lang="EN-US"> </span><o:p></o:p></p>
<p><span lang="EN-US">> 2.) Is there a convinient way to
get a single EdgeIteratorState Object directly by poviding
its ID?</span><o:p></o:p></p>
<p><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"
lang="EN-US">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.</span><o:p></o:p></p>
<p><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"
lang="EN-US"> </span><o:p></o:p></p>
<p><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"
lang="EN-US">Regards,</span><o:p></o:p></p>
<p><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"
lang="EN-US"> </span><o:p></o:p></p>
<p><span
style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Nicolas
GILLET</span><o:p></o:p></p>
<p><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<p><b><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span></b><o:p></o:p></p>
<p><b><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Market-IP
–</span></b><i><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"></span></i><i><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#404040">Creating
Mobile Intelligence</span></i><o:p></o:p></p>
<p><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Phone :
+32 81 33 11 11
</span><o:p></o:p></p>
<p><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Fax :
+32 81 33 11 10</span><o:p></o:p></p>
<p><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><a
moz-do-not-send="true" href="http://www.market-ip.com/"
target="_blank">www.market-ip.com</a> –
<a moz-do-not-send="true" href="http://www.telefleet.com/"
target="_blank">www.telefleet.com</a> – <a
moz-do-not-send="true"
href="http://www.geoplanning.net/" target="_blank">
www.geoplanning.net</a> – <a moz-do-not-send="true"
href="http://www.drivexpert.net/" target="_blank">www.drivexpert.net</a>
</span><o:p></o:p></p>
<p><a moz-do-not-send="true"
href="http://www.linkedin.com/groups/MarketIP-4289716?gid=4289716&trk=hb_side_g"
target="_blank"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;text-decoration:none"><img
moz-do-not-send="true" id="_x0000_i1025"
src="/mess/cid%7E34206;image001.png@01CF0AD5.FD12E720"
alt="Description : cid:image003.png@01CD5521.849F3340"
border="0" height="25" width="30"></span></a><o:p></o:p></p>
<p><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<p><b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif""
lang="FR">De :</span></b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif""
lang="FR">
<a moz-do-not-send="true"
href="mailto:lanmaster@hotmail.ru">lanmaster@hotmail.ru</a>
[<a moz-do-not-send="true"
href="mailto:lanmaster@hotmail.ru">mailto:lanmaster@hotmail.ru</a>]
<br>
<b>Envoyé :</b> lundi 6 janvier 2014 11:47<br>
<b>À :</b> Jrgen Zornig<br>
<b>Cc :</b> GraphHopper Java routing engine<br>
<b>Objet :</b> Re: [GraphHopper] How to consider traffic
jam when route on road network?</span><o:p></o:p></p>
<p> <o:p></o:p></p>
<p>Hello, Jrgen!<br>
<br>
I think about this implementation:<br>
1. We have in-memory arraylist, that contains infos about
traffic jam<br>
2. We have function that can calculate weight of way by two
coordinate pairs (from node / to node)<br>
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.<br>
<br>
Can that implementation be useful, how do you think?<br>
<br>
<br>
Пнд 06 Янв 2014 15:16:52 +0500, Jrgen Zornig <<a
moz-do-not-send="true"
href="/compose/?adb_to=juergen.zornig@gmail.com"
target="_blank">juergen.zornig@gmail.com</a>> написал:<o:p></o:p></p>
<div>
<p>I am also trying to figure out how real time graph
modifications and short and temporary events should be
handled for the routing.<br>
<br>
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.<br>
<br>
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).<br>
<br>
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.<br>
<br>
So I want to add to this question: <br>
<br>
1.) Which flags are included and which position they are
set?<br>
2.) Is there a convinient way to get a single
EdgeIteratorState Object directly by poviding its ID?<br>
<br>
I am in need of these functions to handle real time
traffic data on the graph. <br>
<br>
P.S. Perhaps we can figure it out by ourselves, so Peter
doesn't have to answer every single question ;)
<br>
<br>
Regards,<br>
<br>
Juergen<br>
<br>
Am 06.01.2014 09:54, schrieb <a moz-do-not-send="true"
href="/compose/?adb_to=lanmaster@hotmail.ru"
target="_blank">
lanmaster@hotmail.ru</a>:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p>Graphhopper is a project for finding routes over a road
network. It also provides functionality for weighting
this routing like
<code><span style="font-size:10.0pt">fastest</span></code>
or <code><span style="font-size:10.0pt">shortest</span></code>
path e.g. via the FastestWeighting class. Now, the
question is: how can we extend
<code><span style="font-size:10.0pt">Graphhopper</span></code>
to use the speed data we get from our traffic provider
in realtime?<o:p></o:p></p>
<p>As I can see:<o:p></o:p></p>
<ol start="1" type="1">
<li class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0
level1 lfo1">
We must create a function that gets traffic jam data
from our database.<o:p></o:p></li>
<li class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0
level1 lfo1">
We must force use that modified function (Encoder?)
somewhere in Graphhopper <code>
<span style="font-size:10.0pt">route()</span></code>
function. Do I think right?<o:p></o:p></li>
</ol>
<p>Please show me how we can do this by example.<o:p></o:p></p>
</div>
<p style="margin-bottom:12.0pt"><br>
<br>
<o:p></o:p></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>GraphHopper mailing list<o:p></o:p></pre>
<pre><a moz-do-not-send="true" href="mailto:GraphHopper@openstreetmap.org" target="_blank">GraphHopper@openstreetmap.org</a><o:p></o:p></pre>
<pre><a moz-do-not-send="true" href="https://lists.openstreetmap.org/listinfo/graphhopper" target="_blank">https://lists.openstreetmap.org/listinfo/graphhopper</a><o:p></o:p></pre>
</blockquote>
<p> <o:p></o:p></p>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
GraphHopper mailing list
<a class="moz-txt-link-abbreviated" href="mailto:GraphHopper@openstreetmap.org">GraphHopper@openstreetmap.org</a>
<a class="moz-txt-link-freetext" href="https://lists.openstreetmap.org/listinfo/graphhopper">https://lists.openstreetmap.org/listinfo/graphhopper</a>
</pre>
</blockquote>
<br>
</body>
</html>