<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi Mani,<br>
<br>
thanks for the introduction. How to create a custom weighting is
described <a
href="https://github.com/graphhopper/graphhopper/blob/master/docs/core/weighting.md">here</a>
- i.e. extend from the FastestWeighting and return it in
YourCustomGraphHopper.createWeighting. To pass parameters to it
you put them in the hints either via Java:<br>
request.getHints().put("hi", "mani");<br>
or via URL parameters:<br>
&hi=mani<br>
<br>
You can then read such custom parameters out in the constructor of
your Weighting as the whole hints map is passed to it <a
href="https://github.com/graphhopper/graphhopper/blob/master/core/src/main/java/com/graphhopper/GraphHopper.java#L852">at
creation time</a>. E.g. like <a
href="https://github.com/graphhopper/graphhopper/blob/master/core/src/main/java/com/graphhopper/routing/util/FastestWeighting.java#L45">here</a>.<br>
<br>
Regards,<br>
Peter<br>
<br>
On 07.07.2015 21:03, Manikanta Kondeti wrote:<br>
</div>
<blockquote
cite="mid:CAMxCCEZRw1N6vO8xMkDeah9pV3L9XcU8YJx315_bqf6dJWo-aA@mail.gmail.com"
type="cite">
<div dir="ltr">Hi,
<div><br>
</div>
<div> This is Manikanta. I've been an avid user/developer in
pgrouting. After seeing the fastness in graphhopper, I'm
pretty much interested in understanding it as a user and
developer. Also I am basically new to Java, hoping its not a
problem to learn it as it looks a lot like c++. I've read all
the docs and I can clearly understand the inner underlying
techniques which makes it faster. I love the way you guys
building the graph and also contraction hierarchies stuff
though its not useful for dynamic graph. </div>
<div><br>
</div>
<div> Now I want to tweak the code and basically write a new
custom weighting class. So the first step in doing it is to
tweak the GhRequest and extend a new class from it or use the
same class with additional methods and member variables. Can
you give me an overview of how to proceed? My plan is to take
a few(10) params and pass it to the custom weighting. Is it
possible? Giving me a reference link would help me a lot.
Sorry if this is very basic question. Hope you understand. </div>
<div><br>
</div>
<div>Thank you,</div>
<div>Mani </div>
<div> </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>