[GraphHopper] How graphhopper handle the barrier=gate?
John Zhao
johnthu at gmail.com
Thu Jul 23 20:24:09 UTC 2015
got it. Thanks.
*Best Regards,*
*ZhiQiang ZHAO*
On Thu, Jul 23, 2015 at 1:15 PM, Peter <graphhopper at gmx.de> wrote:
>
> Hi ZhiQiang,
>
> > Actually, you can use turn restriction to avoid the virtual edge.
>
> Yes, but you can disable turn restriction and still want barrier support.
> Also currently CH is not working with turn restriction.
>
>
> > I assume the turn restriction feature was implemented later than
> barrier=gate.
>
> 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:
> https://github.com/graphhopper/graphhopper/issues/388#issuecomment-88066385
> 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.
>
> BTW: the edge at a gate is not called virtual edge as we 'reserved' this
> name for edges creates in the query graph :)
>
> Kind Regards,
> Peter
>
>
> On 22.07.2015 02:41, John Zhao wrote:
>
> Hi Peter,
>
> I am a little understand why Graphhopper use a virtual edge at gate.
> Cause you may need support car and foot at the same time.
> Then you can disable that virtual edge on car, but enable it on foot.
> That's why you don't just simply break the segment there.
>
> Actually, you can use turn restriction to avoid the virtual edge.
> I assume the turn restriction feature was implemented later than
> barrier=gate.
>
>
> *Best Regards,*
> *ZhiQiang ZHAO*
>
> On Thu, Jul 9, 2015 at 12:23 AM, Peter <graphhopper at gmx.de> wrote:
>
>> You can block the edge like you restrict access of any other edge:
>> set the access bits to false - it should be something like this:
>> edge.setFlags(encoder.setAccess(edge.getFlags(), false, false))
>>
>> Peter
>>
>>
>> On 09.07.2015 09:13, John Zhao wrote:
>>
>> Hi Peter,
>>
>> I understand it's in each flager.
>> My question is how GH block that zero length edge.
>> I don't find the corresponding log.
>>
>> I think there are several ways to handle this:
>> 1. convert it to turn restriction.
>> 2. create a virtual node, but don't connect the virtual node and real
>> node. Then they are not connected.
>>
>> But graphhopper use another way:
>> create a virtual node. then create an virtual edge between the virtual
>> node and real node.
>> I guess GH need to make some special configure on the virtual edge.
>>
>> *Best Regards,*
>> *ZhiQiang ZHAO*
>>
>> On Thu, Jul 9, 2015 at 12:08 AM, Peter <graphhopper at gmx.de> wrote:
>>
>>> If and how a barrier is blocking is handled in the specific
>>> FlagEncoder:
>>>
>>>
>>> https://github.com/graphhopper/graphhopper/blob/master/core/src/main/java/com/graphhopper/routing/util/CarFlagEncoder.java#L86
>>>
>>> Regards,
>>> Peter
>>>
>>>
>>> On 09.07.2015 02:43, John Zhao wrote:
>>>
>>> Hi,
>>>
>>> I looked into OSMReader.processWay( )
>>> There is already a lot of comments. But it's still not clear to me. :p
>>>
>>> I understand GH will create a "virtual" node, with the same lat/lon.
>>> And then create a new edge between the 2 nodes.
>>> But how to block this edge?
>>> set the direction bit of the zero length edge both to false? where is
>>> the code?
>>>
>>> // create zero length edge for barriercreatedEdges.addAll(addBarrierEdge(newNodeId, nodeId, wayFlags, nodeFlags, wayOsmId));
>>>
>>> *Best Regards,*
>>> *ZhiQiang ZHAO*
>>>
>>>
>>
>>
>
> _______________________________________________
> 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/20150723/7c38e261/attachment.html>
More information about the GraphHopper
mailing list