Profile debug script which fetches a way from OSM#5908
Profile debug script which fetches a way from OSM#5908akashihi merged 3 commits intoProject-OSRM:masterfrom systemed:debug_way
Conversation
jcoupey
left a comment
There was a problem hiding this comment.
Handy script indeed, just tested it.
profiles/debug_way.lua
Outdated
| -- | ||
| -- You'll need to install luasec and xml2lua first: | ||
| -- > luarocks-5.1 install xml2lua | ||
| -- > luarocks-5.1 install luasec |
There was a problem hiding this comment.
It looks like luasec isn't really required? I got an error all right prior to installing xml2lua but nothing related to not having run luarocks install luasec.
There was a problem hiding this comment.
I've rephrased the comment to note that you may have this already (my Ubuntu box and Mac didn't).
profiles/debug_way.lua
Outdated
| -- [may require admin privileges] | ||
| -- | ||
| -- Then to test way 2606296 using the foot profile: | ||
| -- > lua5.1 debug_way.lua foot 2606296 |
There was a problem hiding this comment.
My system (Ubuntu) currently does not have lua5.1 installed but lua5.2 which is also accessible via the lua generic command. If the same apply across other systems, pointing to simply lua would make it more generic.
There was a problem hiding this comment.
I guess it applies not only for ubuntu, so indeed, this needs to be just lua
There was a problem hiding this comment.
No problem, changed (blame Homebrew for this one ;) ).
akashihi
left a comment
There was a problem hiding this comment.
Please replace docs references to 5.1 with more generic references to lua
Profile debug script which fetches a way from OSM
Issue
When debugging profile issues (e.g. #5892), it's useful to be able to see instantly what the profile is calculating for a given way, without having to reprocess a whole OSM extract.
This short script fetches a way from the OSM API and runs the requested Lua profile over it, then prints the result:
It uses the existing debug handler (tweaked to not error on the missing
get_location_tagC++ method) and builds upon the exampleprofile_debugger.luascript.I use a similar script to this for cycle.travel and have found it enormously helpful in debugging profile issues.
Tasklist
Requirements / Relations
Required Lua libraries are listed in the comments at the top of the script.