<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>
      this should be easy if you use the HTTP communication ('pseudo
      REST'):<br>
       1. start the server, which makes the <a
href="https://github.com/graphhopper/graphhopper/blob/master/docs/web/api-doc.md">web
        api</a> available on localhost:8989<br>
       2. in node.js you can then e.g. (re)use the separate client in
      javascript from <a
        href="https://github.com/graphhopper/directions-api-js-client">here</a>
      but have not tested it in node.js only within the browser<br>
      <br>
      Regards,<br>
      Peter<br>
      <br>
      PS: please when replying the mailinglist emails make sure your
      answers go to <a class="moz-txt-link-abbreviated" href="mailto:graphhopper@openstreetmap.org">graphhopper@openstreetmap.org</a> instead of the
      personal email<br>
      <br>
      On 09.07.2015 01:37, Manikanta Kondeti wrote:<br>
    </div>
    <blockquote
cite="mid:CAMxCCEbHyLcH433S5wm7GymniDBoxhe6J9osL+4+JqvsO3w3yQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi Peter, 
        <div><br>
        </div>
        <div>Thanks a lot for the reply. I am writing a small
          application where the backend is in Node js. I want to create
          a bridge communication between routing engine (graphhopper
          which is in java) and server code(node js). I've found a node
          lib node-java-maven which helps to create tht communication
          but I am not sure how. Is it possible? If yes how do I start.
          I am basically new to Java and trying to figure out Java
          frameworks. Summary is I am trying to create client, server in
          node-js and basically want to pass the params to server,
          server- java(graphhopper), calculate route and send it back. I
          want to understand that communication between java and node.
          What are your thoughts on it? Your advice will help me a lot.
           </div>
        <div><br>
        </div>
        <div>Thanks, </div>
        <div>Mani   </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Wed, Jul 8, 2015 at 12:48 PM, Peter
          <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:graphhopper@gmx.de" target="_blank">graphhopper@gmx.de</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000">
              <div>Hi Mani,<br>
                <br>
                thanks for the introduction. How to create a custom
                weighting is described <a moz-do-not-send="true"
href="https://github.com/graphhopper/graphhopper/blob/master/docs/core/weighting.md"
                  target="_blank">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 moz-do-not-send="true"
href="https://github.com/graphhopper/graphhopper/blob/master/core/src/main/java/com/graphhopper/GraphHopper.java#L852"
                  target="_blank">at creation time</a>. E.g. like <a
                  moz-do-not-send="true"
href="https://github.com/graphhopper/graphhopper/blob/master/core/src/main/java/com/graphhopper/routing/util/FastestWeighting.java#L45"
                  target="_blank">here</a>.<br>
                <br>
                Regards,<br>
                Peter
                <div>
                  <div class="h5"><br>
                    <br>
                    On 07.07.2015 21:03, Manikanta Kondeti wrote:<br>
                  </div>
                </div>
              </div>
              <blockquote type="cite">
                <div>
                  <div class="h5">
                    <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>
                  </div>
                </div>
              </blockquote>
            </div>
          </blockquote>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>