Open maxmaxmaxmaxmaxmaxmax opened 1 month ago
You could probably start with a real OSM extract and add "phantom" ways between chosen nodes. I don't think you can really "set the distance to 0", as distances are computed based on coordinates. What you could do instead is making sure the profile sets a weight
(internal OSRM cost metric) of 0 to those ways. That would happen by tagging the special ways with a custom "highway"=worm_hole
or similar, then adding the matching logic in lua.
Thanks so much @jcoupey . Could you help me find the documentation for the Lua files related to this? I’ve already tried adding them, but I couldn’t find any documentation on the profile Lua scripts. Which method would I need to adjust? I tried using process_way but without success. Also, that would change the distance in the calculation, which ultimately affects the fuel consumption. Would you recommend breaking out the “worm_hole” way in a second layer and determining the distance separately?
if data.highway == "worm_hole" then
result.weight = 0
end
also this is not working
if data.highway == "worm_hole" then
result.weight = 0
return
end
More background info on profiles: https://github.com/Project-OSRM/osrm-backend/blob/master/docs/profiles.md.
Hi,
I’m working on a game and would like to generate something similar to a wormhole.
The basic idea is to modify the car.lua profile so that I can create a connection, for example, from the USA to Asia that goes through the Pacific, making the Earth “round.”
I was thinking that the simplest approach would be to create a connection between two points and set the distance to 0. However, this doesn’t seem to work as expected.
Does anyone have any ideas or could help me with this?