You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As per the discussion in #994 (and links therein), we probably need to consider the purpose of LocationIndexMatch.findNClosest, and consequently rename and refactor - at the moment it's just a direct port from map-matching, and includes some known 'bugs' (which are listed as TODOs in the code). It probably won't be used outside of map-matching, so it's probably not an urgent fix.
@karussell - maybe you can give some direction for what you'd like to see here?
@karussell - maybe you can give some direction for what you'd like to see here?
Here is a quick list (?)
What you find ugly or what you do not understand :)
I'm good with renaming it to findWithinRadius
Maybe we give it a limit parameter here, e.g. for map matching to return only 3 close results but with different edgeId? I now also understand my old code ;) and why I didn't use a PriorityQueue because this would increase unlimited and we just need the best X and list.add&sort should be faster for dense areas.
Is the maxIteration thing solvable via GraphHopper.maxRegionSearch?
rename GHIntHashSet set = new GHIntHashSet(); to maybe nodeSet?
faster pruning e.g. if a leaf and its parent does not exist the neighboring leaf should not be requested (not sure if this optimization is possible though)
Sounds good, thanks @karussell. So you're happy with the intention of the method to be to find all edges within a given radius? It does mean breaking logic for map-matching as we won't be including some out-of-radius (but in-9-tiles) candidates - but I suspect that's a relatively rare occurrence, and one could argue shouldn't happen anyway. So I'd be happy with that for map-matching.
The current behaviour includes features that we may remove in the more general one - specifically:
if no results are found in radius, return no results. (Currently, in this case, we'll return one from within the nine tiles even if it's outside the radius.)
(not) sorting the results - can't remember if this is required by map-matching or not.
The first will definitely result in some differences in some cases (though as above, pretty rare, and I think it's probably incorrect in it's current state).
Ok. Would you mind to run a measurement how many results we get per request if we include all and if this is slower than the current approach? (as the result is hold in an ArrayList this should be slightly slower for increasing this, but we save time as we do not need to sort the list)
The first will definitely result in some differences in some cases ... pretty rare ...
Eating my hat - I just spent hours trying to figure out why my sequence wasn't breaking (see map-matching). It turned out it was because of this - the route didn't 'break' because map-matching pulled in candidates from well outside the gps accuracy. Silly me.
Ok. Would you mind to run a measurement how many results we get per request if we include all and if this is slower than the current approach? (as the result is hold in an ArrayList this should be slightly slower for increasing this, but we save time as we do not need to sort the list)
At this stage I don't think I'll take this one on, sorry (we're starting to build our house).
Activity
karussell commentedon Mar 22, 2017
Here is a quick list (?)
GHIntHashSet set = new GHIntHashSet();to maybe nodeSet?boldtrn commentedon Mar 22, 2017
I thought the method would return all edges in the radius?
kodonnell commentedon Mar 23, 2017
Sounds good, thanks @karussell. So you're happy with the intention of the method to be to find all edges within a given radius? It does mean breaking logic for map-matching as we won't be including some out-of-radius (but in-9-tiles) candidates - but I suspect that's a relatively rare occurrence, and one could argue shouldn't happen anyway. So I'd be happy with that for map-matching.
karussell commentedon Mar 23, 2017
find X vs. find all: if 'find all' is similar fast I'm for this as this makes the lookup useful for other stuff.
What do you mean here @kodonnell ?
kodonnell commentedon Mar 24, 2017
The current behaviour includes features that we may remove in the more general one - specifically:
The first will definitely result in some differences in some cases (though as above, pretty rare, and I think it's probably incorrect in it's current state).
karussell commentedon Mar 25, 2017
Ok. Would you mind to run a measurement how many results we get per request if we include all and if this is slower than the current approach? (as the result is hold in an ArrayList this should be slightly slower for increasing this, but we save time as we do not need to sort the list)
kodonnell commentedon Mar 28, 2017
Eating my hat - I just spent hours trying to figure out why my sequence wasn't breaking (see map-matching). It turned out it was because of this - the route didn't 'break' because map-matching pulled in candidates from well outside the gps accuracy. Silly me.
At this stage I don't think I'll take this one on, sorry (we're starting to build our house).
karussell commentedon Sep 10, 2018
Closing as duplicate of #1324 (I think, if not please reopen)