<div dir="ltr">got it. Thanks.</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><b>Best Regards,</b><div><b>ZhiQiang ZHAO</b></div></div></div>
<br><div class="gmail_quote">On Thu, Jul 23, 2015 at 1:15 PM, Peter <span dir="ltr"><<a 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">
  
    
  
  <br>
  <div bgcolor="#FFFFFF" text="#000000">
    Hi ZhiQiang,<span class=""><br>
    <br>
    > Actually, you can use turn restriction to avoid the virtual
    edge.<br>
    <br></span>
    Yes, but you can disable turn restriction and still want barrier
    support. Also currently CH is not working with turn restriction.<br>
    <br>
    <br>
    <div><span class="">> I assume the turn restriction feature was implemented
      later than barrier=gate.<br>
      <br></span>
      Yes, but I think it should not be implemented as a turn
      restriction because the access does not really depend on the
      source edge - if it does, then it is incorrectly mapped. See here
      the discussion and open issue #388:<br>
<a href="https://github.com/graphhopper/graphhopper/issues/388#issuecomment-88066385" target="_blank">https://github.com/graphhopper/graphhopper/issues/388#issuecomment-88066385</a><br>
      Additionally if edge a to edge b is not accessible then the
      opposite is always false too, which is different to turn
      restrictions or costs.<br>
    </div>
    <br>
    BTW: the edge at a gate is not called virtual edge as we 'reserved'
    this name for edges creates in the query graph :)<br>
    <br>
    Kind Regards,<br>
    Peter<div><div class="h5"><br>
    <br>
    <div>On 22.07.2015 02:41, John Zhao wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">Hi Peter,
        <div><br>
        </div>
        <div>I am a little understand why Graphhopper use a virtual edge
          at gate.</div>
        <div>Cause you may need support car and foot at the same time.</div>
        <div>Then you can disable that virtual edge on car, but enable
          it on foot.</div>
        <div>That's why you don't just simply break the segment there.</div>
        <div><br>
        </div>
        <div>Actually, you can use turn restriction to avoid the virtual
          edge.</div>
        <div>I assume the turn restriction feature was implemented later
          than barrier=gate.</div>
        <div><br>
        </div>
      </div>
      <div class="gmail_extra"><br clear="all">
        <div>
          <div><b>Best Regards,</b>
            <div><b>ZhiQiang ZHAO</b></div>
          </div>
        </div>
        <br>
        <div class="gmail_quote">On Thu, Jul 9, 2015 at 12:23 AM, Peter
          <span dir="ltr"><<a 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>You can block the edge like you restrict access of
                any other edge:<br>
                set the access bits to false - it should be something
                like this:<br>
                edge.setFlags(encoder.setAccess(edge.getFlags(), false,
                false))<span><font color="#888888"><br>
                    <br>
                    Peter</font></span>
                <div>
                  <div><br>
                    <br>
                    On 09.07.2015 09:13, John Zhao wrote:<br>
                  </div>
                </div>
              </div>
              <div>
                <div>
                  <blockquote type="cite">
                    <div dir="ltr">Hi Peter,
                      <div><br>
                      </div>
                      <div>I understand it's in each flager.</div>
                      <div>My question is how GH block that zero length
                        edge.</div>
                      <div>I don't find the corresponding log.</div>
                      <div><br>
                      </div>
                      <div>I think there are several ways to handle
                        this:</div>
                      <div>1. convert it to turn restriction.</div>
                      <div>2. create a virtual node, but don't connect
                        the virtual node and real node. Then they are
                        not connected.</div>
                      <div><br>
                      </div>
                      <div>But graphhopper use another way:</div>
                      <div>create a virtual node. then create an virtual
                        edge between the virtual node and real node.</div>
                      <div>I guess GH need to make some special
                        configure on the virtual edge.</div>
                    </div>
                    <div class="gmail_extra"><br clear="all">
                      <div>
                        <div><b>Best Regards,</b>
                          <div><b>ZhiQiang ZHAO</b></div>
                        </div>
                      </div>
                      <br>
                      <div class="gmail_quote">On Thu, Jul 9, 2015 at
                        12:08 AM, Peter <span dir="ltr"><<a 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>If and how a barrier is blocking is
                              handled in the specific FlagEncoder:<br>
                              <br>
                              <a href="https://github.com/graphhopper/graphhopper/blob/master/core/src/main/java/com/graphhopper/routing/util/CarFlagEncoder.java#L86" target="_blank">https://github.com/graphhopper/graphhopper/blob/master/core/src/main/java/com/graphhopper/routing/util/CarFlagEncoder.java#L86</a><br>
                              <br>
                              Regards,<br>
                              Peter
                              <div>
                                <div><br>
                                  <br>
                                  On 09.07.2015 02:43, John Zhao wrote:<br>
                                </div>
                              </div>
                            </div>
                            <blockquote type="cite">
                              <div>
                                <div>
                                  <div dir="ltr">Hi,
                                    <div><br>
                                    </div>
                                    <div>I looked into
                                      OSMReader.processWay( )</div>
                                    <div>There is already a lot of
                                      comments. But it's still not clear
                                      to me. :p</div>
                                    <div><br>
                                    </div>
                                    <div>I understand GH will create a
                                      "virtual" node, with the same
                                      lat/lon.</div>
                                    <div>And then create a new edge
                                      between the 2 nodes.</div>
                                    <div>But how to block this edge?</div>
                                    <div>set the direction bit of the
                                      zero length edge both to false?
                                      where is the code?</div>
                                    <div>
                                      <pre style="color:rgb(0,0,0);font-family:Menlo;font-size:12pt"><span style="color:rgb(128,128,128);font-style:italic">// create zero length edge for barrier
</span>createdEdges.addAll(addBarrierEdge(newNodeId, nodeId, wayFlags, nodeFlags, wayOsmId));</pre>
                                      <div>
                                        <div><b>Best Regards,</b>
                                          <div><b>ZhiQiang ZHAO</b></div>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                  <br>
                                </div>
                              </div>
                            </blockquote>
                          </div>
                        </blockquote>
                      </div>
                    </div>
                  </blockquote>
                  <br>
                </div>
              </div>
            </div>
            <br>
          </blockquote>
        </div>
      </div>
    </blockquote>
    <br>
  </div></div></div>

<br>_______________________________________________<br>
GraphHopper mailing list<br>
<a href="mailto:GraphHopper@openstreetmap.org">GraphHopper@openstreetmap.org</a><br>
<a href="https://lists.openstreetmap.org/listinfo/graphhopper" rel="noreferrer" target="_blank">https://lists.openstreetmap.org/listinfo/graphhopper</a><br>
<br></blockquote></div><br></div>