-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make travel time and edge weights independent #77
Comments
I have been entertaining the idea of designing some 'descriptive language' to allow users to specify more or less complex data extraction according to their needs. I am thinking of something a bit like the way cucumber specifies test scenarios. I need to think about that more. |
a simple way to get started would be to use specific parameters in specific situations, like i wrote above. but a more flexible way to specify weights depending on tags would be even better, a long as it doesn't slow down preprocessing or routing too much. here's one idea:
the idea is to divide expression into blocks. in the example above, there's a block with 4 rows at the top, and two blocks with just one line. all blocks are evaluted from the top, but only one the first expression in each block that's true is used to adjust the weight. i guess the goal is to find a good balance between flexibility and easy of use. c++ would be provide the ultimate flexibility, but be too hard to use. a simple list of highway=footway: 0.8, surface=cobblestone: 0.6 type of list might not be flexible enough. anyways, just an input. |
Thanks for the input. Very much appreciated. |
also might be worth looking at opentripplanner, i believe they're using xml files somehow |
in reality there might not be that many different parameters that people want to adjust. here's what i can think of right now for bike routing: prefer bike tracks i'm not saying they're not important - i think they are. it's things that are not well handles by the speedprofile alone. the logic of how these interact is probably fixed (it should follow common sense), so it's worth considering it's good enough to simply let people adjust a fixed set of parameters (like the list above) and use these values in the code according to some meaningful, but fixed scheme. much like the router handles oneways, etc. |
I wonder if there's any evolution on this issue. Thank you maxx |
Yes, the LUAEngine branch is under development right now and will deliver this feature. |
@emmexx hi, we're also working on bike routing. i would be curious to hear more about what you're working on :-) |
Il 06/14/2012 08:18 AM, Emil Tin scrisse:
Hi Emil Tin, I'm working on a project on bike routing in the city of Milan. We made a survey of the streets of Milan to update osm data. We based
I'll start updating osm data in a few days. Unfortunately I was suggested to use osrm but I didn't check the way it We don't have much time spared, we'll present the project at the end of I don't know what is LUAEngine, I didn't find any info on github, I If there's already some working code, I can test it or work on it. If you can give me some additional info, you're welcome. bye |
In the meantime you can just add your customisations to DataStructures/ExtractorCallBacks.h around line 160 to adjust the speed limit depending on tags. |
Il 06/14/2012 09:26 AM, Emanuel Posescu scrisse:
Yes, of course, but it's a pity to write code that will Anyway if I can be of any help with the LUAEngine, let me know. Thank you |
LUA is a language quite similar to javascript. the idea is to move all the tags parsing to small lua scripts, so it's easier to customize it depending on need. we setup a prototype using osrm and a bicycle speedprofile at http://stormy-flower-5599.herokuapp.com/en. it incorporates turn penalties, as implemented with #240. but we're also looking forward to a more flexible tag parsing and weight system. can you tell more about the custom tag that want to use? |
Il 06/14/2012 09:42 AM, Emil Tin scrisse:
I agree, this is important to customize the routing for different
I'll check it asap.
I'm going to create a osm wiki page today or tomorrow.
cycling_width is the width that a cyclist has in order to ride in a As soon as I write the wiki page, I'll send you a msg. Thank you |
note that the prototype doesn't work with internet explorer. click on the map to set start/end markers, then try dragging them around. are you talking about the width of a painted cycle lane? i think using an existing tag, like cycleway:width, will save you a lot of trouble. cycleway:width seems to have some use: http://taginfo.openstreetmap.org/search?q=cycleway also, subjective values like 'sufficient' and 'good' are hard for people to agree on, and use. meters are much better. |
Il 06/14/2012 10:13 AM, Emil Tin scrisse:
So you are one of the fundamentalists! :-) No, I'm not referring to cycle lanes. I'll try to be more precise in the wiki page bye |
nah, i'm practical. |
Il 06/14/2012 12:42 PM, Emil Tin scrisse:
In italy usally the road is shared by:
In a 2 way road part of it is for parked cars. The tag width is used for the total width of the road, so it is not useful. bye |
cycleway:width indicates the width of the bike track/lane only |
Il 06/14/2012 05:00 PM, Emil Tin scrisse:
If you're referring to the "width" I wrote in my last msg, I was http://wiki.openstreetmap.org/wiki/Key:width bye |
Now that Lua has met osrm I return to this thread to ask some question. thanks |
the branch develop...feature/lua_weights allows you to set a weight in the lua way_function. the weight is multiplied with the speed to calculate the total impedance/cost of each segment. this means you can prioritize ways depending on tags. for example, the testbot profile directly reads the 'weight' tag and uses it to set the weight:
here, asb is chosen, even though both distance and travle time is longer than ab. this would be desirable when you want to prioritize bike routes, parks, etc. speed and weight are stored for each edge, instead of just the weight. what's missing: the total travel time should not be influenced by the weight, but it currently is. and parsing of relations in the lua script (ex bike routes). @prozessor13 demonstrated one way to parse bike relations over at #546. some weight tests can be run using "cucumber -t @weight" |
Hi Emiltin, a couple of month ago I tried to test your code on my city but the results were not very good. It could be that I set the parameters wrong in the profile but, for most of the routes, there was no difference between the master and your code. I couldn't understand why. For the travel time I found out that it is easier to use a fixed speed in the javascript code, adding a fixed time for every turn. The results are in good agreement with real travel times. So now I'm using the travel time of osrm as weight and the results are good. bye |
hi emmexx, could you be confusing this with turn penalties? this branch handles custom weights on ways, not turn penalties. alos note that it doesn't yet implement anything in the car, bike or foot profile, only in the testbot profile. regarding travel time for turns (not related to this branch) the purpose is to avoid trips with many turns not simply calculate the travel time. |
I was talking about weights. if surface="sett" then There's a misunderstanding about travel times and turn: bye |
the point of the branch is to allow you to set weight and speed independently. they're then multiplied to get the total cost of the segment. without separating them, you cannot prioritize certain types of ways without getting the speed wrong. (but what's currently missing is getting the travel time correct. but it should be possible, since weight and speed are stored separately for each segment). assuming the same average speed everywhere and recalculating the travel on the client end might be a workaround, but seems a bit rough. for example, in the features/lua_turn_penalty branch, the turn penalty is higher for sharper turns. also note the osrm can optionally add penalties for passing traffic_signals. if you work with elevation, it needs to be factored into travel time as well. one factor we're considering adding on the client end is current/forecasted wind situation. |
Ok for weight and speed. I studied and debugged your code and made some modification to it to no avail. As I already wrote, a fixed speed is rough but for short distances it is not much different than real times. For different enviroments where you have to consider elevation or wind, a fixed speed isn't a good solution. bye |
I would be extremely happy to be able to use a weight parameter (instead of speed) for bicycle routing. weight would a function of (speed, "safety", "comfort") (generally a non linear function) and speed would only calculate the route length. a draft of safety is at http://wiki.freemap.sk/BicykelPreprocessing (the less the safer), comfort is based on surface, speed is either normal or slow/walking (or different, depending on incline) incline: can I add a different speed to different direction of road? similar to oneway, in which one direction has speed of 0. |
Congratulations @oxidase @jakepruitt and everyone that worked on #2399, we can now close this issue after 4 (in words FOUR) years of its creation. EDIT: I actually it's 2017 now so 5 years. Wow. |
Hurray! |
Congrats everyone! |
Anyone who has been watching this ticket - we've merge into master but feedback on this feature would be really helpful. Anyone who has the time to test it out, please do and open tickets with any problems/confusion you encounter. |
i think it will be imporant to be able to set 'attractiveness' on ways depending on certain tags.
this should be separate from the speed, since it's still important to have the correct speeds for each sections, so that a estimated travel time can be computed.
for example, we want to prioritize streets with bike tracks over streets without, even though the speed might be the same, or slightly lower. the same goes for green routes, which people often prefer over a big road, even though the speed might be similar or lower.
one way it could be done simply is by hardcoding the tag combinations in osrm, but allowing the weight to be set in the speedprofile. something like:
if(accesTag=='bicycle' && cycleway=='track')
attractiveness = w.keyVals.Find("bike_track_attractiveness"); //value set in speedprofile, say 1.4
else if(accesTag=='bicycle' && cycleway=='lane')
attractiveness = w.keyVals.Find("bike_lane_attractiveness"); //value set in speedprofile, say 1.2
else if(accesTag=='bicycle' && route != nil)
attractiveness = w.keyVals.Find("bike_route_attractiveness"); //value set in speedprofile, say 1.5
//other cases goes here....
else
attractiveness = 1.0;
The text was updated successfully, but these errors were encountered: