[GraphHopper] Fwd: Re: instruction too early

Peter graphhopper at gmx.de
Mon Feb 16 21:15:50 UTC 2015


Hi Laura,

before Jan tries ... I can remember roughly you are still using 0.3
right? Please try 0.4 and see if this is better. See e.g.:
https://github.com/graphhopper/graphhopper/issues/295

Peter

On 16.02.2015 22:08, Jan Soelter wrote:
> Hi Laura,
>
> thanks for the clarification. i will take a look into this, but it would
> be helpfull if you can provide me start and end point of the route, as
> well as one or two points where there is a wrong instruction or one missing.
>
> Jan
>
>> Hello, thanks for your reply, I was not referring to that issue but it is
>> quite similar to was happen to me... however I know that graphhopper
>> generate all the instructions for the route, I check it out every time.
>> The problem is that it gives me the wrong instruction at the wrong time.
>> The sniped code you see is part of the class that overrides
>> MyLocationOverlay, on the onLocationChanged method.
>> I tell graphhopper to give me the next instruction in this piece of code:
>> Instruction instruction = il.find(location.getLatitude(),
>> location.getLongitude(), 2);
>> il is the InstructionList that is created as part of the route, I pass it
>> to the class and every time that location changes I check if there is
>> anything to say to the user.
>
>
>> Hi Laura,
>>
>>
>>> Hello everyone: I notices that graphhopper is giving me the
>>> instructions too early and sometimes it wont even give me anything,
>>> I think I read about an issue pointing that but now is close...
>> maybe you refer to this issue
>> https://github.com/graphhopper/graphhopper/issues/94 regarding missing
>> instructions?
>>
>>
>>> I override MyLocationOverlay class, and this is my code:
>>> @Override public void onLocationChanged(Location location) {
>>> super.onLocationChanged(location);
>>> if (lastLocation == null || location != lastLocation) {
>>> lastLocation = location; if (il != null) { Instruction instruction
>>> = il.find(location.getLatitude(), location.getLongitude(), 2); if
>>> (instruction != null && instruction !=
>> lastInstruction) {
>>> lastInstruction = instruction; String text =
>> lastInstruction.getTurnDescription(esTR);
>>> Toast.makeText(context, text,
>> Toast.LENGTH_LONG).show();
>>> if (tts != null) { tts.speak(text, TextToSpeech.QUEUE_FLUSH,
>>> null); } } } } }
>> I would take a look into this, but I don't understand yet where exactly
>> your code hooks into the GraphHopper Code. I do not see any
>> LocationOverlay class, but maybe you can point me there with a github
>> link.
>>
>>
>>> Note that it suppose to give me the instruction with at list 2
>>> meters of distance, last time I check it gave me the instruction
>>> with at list 5 meters of distance in the first edge...the next turn
>>> wont dispatch anything at all...what could be happening? My start
>>> point now is branch "issue 314" since I haven't being able to
>>> download the complete repository(problems with my connection). any
>>> help will be appreciated.
>>
>>
>> Cheers,
>> Jan
>>




More information about the GraphHopper mailing list