-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Profile debug script which fetches a way from OSM #5908
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it applies not only for ubuntu, so indeed, this needs to be just lua
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem, changed (blame Homebrew for this one ;) ).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_tag
C++ method) and builds upon the exampleprofile_debugger.lua
script.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.