{"action":"created","issue":{"url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/1776","labels_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/1776/labels{/name}","comments_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/1776/comments","events_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/1776/events","html_url":"https://github.com/Project-OSRM/osrm-backend/issues/1776","id":117423639,"number":1776,"title":"Unable to use way.id inside way_function","user":{"login":"p4bloch","id":3620912,"avatar_url":"https://avatars.githubusercontent.com/u/3620912?v=3","gravatar_id":"","url":"https://api.github.com/users/p4bloch","html_url":"https://github.com/p4bloch","followers_url":"https://api.github.com/users/p4bloch/followers","following_url":"https://api.github.com/users/p4bloch/following{/other_user}","gists_url":"https://api.github.com/users/p4bloch/gists{/gist_id}","starred_url":"https://api.github.com/users/p4bloch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/p4bloch/subscriptions","organizations_url":"https://api.github.com/users/p4bloch/orgs","repos_url":"https://api.github.com/users/p4bloch/repos","events_url":"https://api.github.com/users/p4bloch/events{/privacy}","received_events_url":"https://api.github.com/users/p4bloch/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-11-17T18:53:50Z","updated_at":"2016-01-04T17:06:31Z","closed_at":"2016-01-04T17:06:31Z","body":"I need to check every `way_id` against a postgresql database in order to add weight to it and make the router avoid it.\r\n\r\nThe problem is, inside way_function, I am not able to use `way.id`. This is the error I get when I try to print it:\r\n~~~\r\nterminate called after throwing an instance of 'osrm::exception'\r\n  what():  ERROR occured in profile script:\r\nNo matching overload found, candidates:\r\nvoid print(std::string)\r\n~~~\r\n\r\nAnd when trying to concatenate it like this `local sql_query = \"SELECT rating FROM bk_rating WHERE way_id = \" .. way.id .. \" \"`, I get the following error\r\n~~~\r\nterminate called after throwing an instance of 'osrm::exception'\r\n  what():  ERROR occured in profile script:\r\nprofile.lua:170: attempt to concatenate field 'id' (a function value)\r\n~~~ \r\n\r\nI've been trying to find answers to this error in the Lua community but none of the solutions seems to apply for OSRM. Is the `way.id` actually available in the `way` that is passed as a parameter to `way_function`? Am I calling it the right way? I took the query from [this postgis.lua example](https://github.com/springmeyer/Project-OSRM/blob/master/profiles/examples/postgis.lua)\r\n\r\nBest,\r\nPablo"},"comment":{"url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/comments/168737309","html_url":"https://github.com/Project-OSRM/osrm-backend/issues/1776#issuecomment-168737309","issue_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/1776","id":168737309,"user":{"login":"TheMarex","id":606968,"avatar_url":"https://avatars.githubusercontent.com/u/606968?v=3","gravatar_id":"","url":"https://api.github.com/users/TheMarex","html_url":"https://github.com/TheMarex","followers_url":"https://api.github.com/users/TheMarex/followers","following_url":"https://api.github.com/users/TheMarex/following{/other_user}","gists_url":"https://api.github.com/users/TheMarex/gists{/gist_id}","starred_url":"https://api.github.com/users/TheMarex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheMarex/subscriptions","organizations_url":"https://api.github.com/users/TheMarex/orgs","repos_url":"https://api.github.com/users/TheMarex/repos","events_url":"https://api.github.com/users/TheMarex/events{/privacy}","received_events_url":"https://api.github.com/users/TheMarex/received_events","type":"User","site_admin":false},"created_at":"2016-01-04T17:06:31Z","updated_at":"2016-01-04T17:06:31Z","body":"Closing here as the actual issue has been resolved."}}