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
The /isochrone and /spt endpoints currently do not support turn costs. We need to run the algorithm edge-based to support this.
To make things a bit less complicated these endpoints currently can be used also for profiles with turn_costs: false and the turn costs are simply disabled silently, c.f. this discussion: #1967
Finished, up to the fact that for /spt, edge based traversal really is something different than just respecting turn restrictions. You get a different kind of tree, where you get every node several times.
How to make it clear that this happens iff your profile has turn restrictions?
Maybe I can also want this if it has no turn restrictions?
You get a different kind of tree, where you get every node several times.
Hm this seems to depend on the requested columns? For example if all I want are the coordinates, times and distances (the default) we should probably use the minima for every node? But if also the (previous) edge_ids etc. are requested we could just return all the entries of the shortest path tree? Or maybe that is what we do already?
How to make it clear that this happens iff your profile has turn restrictions?
Maybe I can also want this if it has no turn restrictions?
This is indeed ugly and here (and maybe only here?) it would make sense to differentiate between edge_based and turn_costs (#1702)? In one case I might be interested in the edge-based tree and in another I might be interested in the node-based tree. But in which case would I be interested in the edge-based tree without turn costs? The calculation is probably not faster when we skip the turn costs, but the routing becomes less accurate (if we neglect OSM turn restrictions this way)?
A few more minor things:
Don't you think there should be an error when ch/lm.disable=false since the speed modes are not supported for /isochrone and /spt? Ok, since its nowhere specified that ch/lm.disable=false even exist for /isochrone and /spt there is no need to explicitly deny them, they are simply ignored just like all other parameters that do not exist. Then again I would prefer to strictly forbid all non-existing parameters, but that's another story.
We now get an internal server error for something like this: /spt?point=xyz. Might be the same as in Internal Server Error when sending POST request to /route without specifying points #1995. Taking into account that we also get 404 when parameters have the wrong type I wonder if we should put all query parameters as strings and do the parsing manually (maybe not so elegant but at least then we can control the error codes). Or maybe this is just a minor bug that can be fixed still using the framework mechanisms.
Should it be allowed to use dashes in profile names, like car-with-turncosts?
Why not? I don't know the legacy of this, but in my mind, it's just a string, a resource name. I don't want to interpret it in any way.
404 [..] Or maybe this is just a minor bug that can be fixed still using the framework mechanisms.
Will check, but if it isn't -- I want to to as little as possible of this manually, and I want to release control about this and give it to conventions / frameworks. For me, that's the point.
For example if all I want are the coordinates, times and distances (the default) we should probably use the minima for every node? But if also the (previous) edge_ids etc. are requested we could just return all the entries of the shortest path tree? Or maybe that is what we do already?
Noooo, a tree is a tree, it can't suddenly change its structure depending on the columns I request. (That it does so depending on the profile is questionable, but depending on the columns -- no.) That would mean that there are meaning-of-the-tree-changing columns and other columns. Argll.
Why not? I don't know the legacy of this, but in my mind, it's just a string, a resource name. I don't want to interpret it in any way.
The legacy was that we sometimes had utc-1 in the profile names to indicate infinite u-turn costs. Otherwise you are right a dash is not a problem as a url, yaml or file name, but being a bit more restrictive also sometimes can make things easier(?!). Here I do not see a real reason to allow dash, because one can also just use underscore.
Noooo, a tree is a tree, it can't suddenly change its structure depending on the columns I request. (That it does so depending on the profile is questionable, but depending on the columns -- no.) That would mean that there are meaning-of-the-tree-changing columns and other columns.
Ok I agree changing the columns should better not lead to another result, I was just speculating about what a user expects and came to the conclusion that this might depend on the requested columns. For example if we always return the (edge-based) tree (and the default columns are just the coordinates, times and distances) there are duplicate rows (same coordinates, different times) which I guess is not expected. If on the other hand we remove these 'duplicates' we will be 'missing' some rows when we include the parent edges for example. So maybe for an edge-based tree it just makes no sense to ask for the coordinates of the nodes? If we would list the (road network) edges it would be more clear: Every node of the shortest path tree corresponds to exactly one (directed) edge and every (directed) edge appears at most once in the tree. But sure, what if one asks for 'the' tree including turn costs (not even knowing about edge-based etc.) then things are less clear.
There seem to be multiple different questions one might ask related to the shortest path tree. Not sure which ones our endpoint is supposed to answer:
Give me 'the' shortest path tree (all the nodes with their distances and times from the center point)
Like 1), but pay respect to turn restrictions
Give me the edge-based shortest path tree (for every road of the graph I want to know the time/distance it takes from the center point, for both directions of the road).
Like 3) but this time I want to ignore turn restrictions
Number 4) seems a bit odd to me, and not sure if this is ever needed (also this is already covered by 3) if we make the turn costs configurable for the different profiles). Number 2) would mean first calculating the edge-based tree and then post-processing it (taking the minimum over nodes that have been discovered via different edges).
Activity
michaz commentedon Apr 7, 2020
I already have this on a branch. Coming up.
michaz commentedon Apr 19, 2020
/isochrone
/spt
IsochroneResource can do turn restrictions #1978
SPTResource can do turn restrictions #1978
michaz commentedon Apr 19, 2020
Finished, up to the fact that for /spt, edge based traversal really is something different than just respecting turn restrictions. You get a different kind of tree, where you get every node several times.
How to make it clear that this happens iff your profile has turn restrictions?
Maybe I can also want this if it has no turn restrictions?
easbar commentedon Apr 19, 2020
Cool thanks!
Hm this seems to depend on the requested columns? For example if all I want are the coordinates, times and distances (the default) we should probably use the minima for every node? But if also the (previous) edge_ids etc. are requested we could just return all the entries of the shortest path tree? Or maybe that is what we do already?
This is indeed ugly and here (and maybe only here?) it would make sense to differentiate between
edge_basedandturn_costs(#1702)? In one case I might be interested in the edge-based tree and in another I might be interested in the node-based tree. But in which case would I be interested in the edge-based tree without turn costs? The calculation is probably not faster when we skip the turn costs, but the routing becomes less accurate (if we neglect OSM turn restrictions this way)?A few more minor things:
Don't you think there should be an error whenOk, since its nowhere specified thatch/lm.disable=falsesince the speed modes are not supported for /isochrone and /spt?ch/lm.disable=falseeven exist for /isochrone and /spt there is no need to explicitly deny them, they are simply ignored just like all other parameters that do not exist. Then again I would prefer to strictly forbid all non-existing parameters, but that's another story.We now get an internal server error for something like this:
/spt?point=xyz. Might be the same as in Internal Server Error when sending POST request to /route without specifying points #1995. Taking into account that we also get 404 when parameters have the wrong type I wonder if we should put all query parameters as strings and do the parsing manually (maybe not so elegant but at least then we can control the error codes). Or maybe this is just a minor bug that can be fixed still using the framework mechanisms.Should it be allowed to use dashes in profile names, like
car-with-turncosts? Right now its only allowed for some legacy reasons where something like-1(minus one) had to be included, but this will no longer be the case after fixing Rename CH/LM preparations according to their profile name #1999. See here: Use new profiles section to configure LM&CH preparations #1922 (comment)michaz commentedon Apr 19, 2020
Why not? I don't know the legacy of this, but in my mind, it's just a string, a resource name. I don't want to interpret it in any way.
Will check, but if it isn't -- I want to to as little as possible of this manually, and I want to release control about this and give it to conventions / frameworks. For me, that's the point.
Noooo, a tree is a tree, it can't suddenly change its structure depending on the columns I request. (That it does so depending on the profile is questionable, but depending on the columns -- no.) That would mean that there are meaning-of-the-tree-changing columns and other columns. Argll.
easbar commentedon Apr 19, 2020
The legacy was that we sometimes had
utc-1in the profile names to indicate infinite u-turn costs. Otherwise you are right a dash is not a problem as a url, yaml or file name, but being a bit more restrictive also sometimes can make things easier(?!). Here I do not see a real reason to allow dash, because one can also just use underscore.Ok I agree changing the columns should better not lead to another result, I was just speculating about what a user expects and came to the conclusion that this might depend on the requested columns. For example if we always return the (edge-based) tree (and the default columns are just the coordinates, times and distances) there are duplicate rows (same coordinates, different times) which I guess is not expected. If on the other hand we remove these 'duplicates' we will be 'missing' some rows when we include the parent edges for example. So maybe for an edge-based tree it just makes no sense to ask for the coordinates of the nodes? If we would list the (road network) edges it would be more clear: Every node of the shortest path tree corresponds to exactly one (directed) edge and every (directed) edge appears at most once in the tree. But sure, what if one asks for 'the' tree including turn costs (not even knowing about edge-based etc.) then things are less clear.
easbar commentedon Apr 19, 2020
There seem to be multiple different questions one might ask related to the shortest path tree. Not sure which ones our endpoint is supposed to answer:
Number 4) seems a bit odd to me, and not sure if this is ever needed (also this is already covered by 3) if we make the turn costs configurable for the different profiles). Number 2) would mean first calculating the edge-based tree and then post-processing it (taking the minimum over nodes that have been discovered via different edges).
Update ios_compatibility branch to graphhopper 1.0 release state. (#2383