On Wed, 29 Jul 2020 at 16:50, André Siefken <sief...@geozelot.com> wrote:
>
> assuming I would attempt to replace the result.ref with the actual way ID, 
> how would I retrieve the actual ID from the passed in way, as it is no tag?

Consider way_function, the way object passed in has attributes.
Typically, those are OSM tags, but it does not have to be OSM tag.
For example, you can preprocess non-OSM data into PBF to make it look
& feel like OSM in order to let OSRM digest it.
You can assign your nodes and ways with `ref` identifiers of your own
scheme, it does not have to be OSM identifiers.

Moreover, whatever properties are attached to way objects, you can
access them inside lua profiles

local way_i = way:get_value_by_key('this_is_my_custom_way_id)
local way_n = way:get_value_by_key('this_is_my_custom_way_name)

result.name = way_n
result.ref = way_i
result...

> Can I use property notation like way.id or similar

result.ref

but the value can be based on a custom scheme, it does not have to be
OSM identifiers.

See also
https://www.winwaed.com/blog/2015/11/18/osrms-lua-scripts/
https://github.com/Project-OSRM/osrm-backend/blob/master/docs/profiles.md
The last one is a bit out of date w.r.t. Lua fuction names.

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net

_______________________________________________
OSRM-talk mailing list
OSRM-talk@openstreetmap.org
https://lists.openstreetmap.org/listinfo/osrm-talk

Reply via email to