Search code examples
here-api

Is it possible to convert HERE v7 link IDs to v8 segment IDs?


I have a HERE v7-based routing app that uses stored link IDs with the avoidLinks parameter to avoid certain road segments when calculating routes. Is there a straightforward way to convert v7 link IDs to segment IDs that can be used with the avoid[segments] parameter in the v8 API?


Solution

  • straightforward way doesn't exist but below is not difficult:

    1. Get tile id/tile ids for each target link id utilize request like https://smap.hereapi.com/v8/maps/index.json?layer=ROAD_GEOM_FCn&attributes=LINK_ID&values=17340430,565725162&apikey=

    2. Take from above response functional class (level - (minus) 8) then set it to TOPO_SEG_ID_FCx (instead of x) and tile id/tile ids then send it like: https://smap.hereapi.com/v8/maps/attributes.json?layers=TOPO_SEG_ID_FC5,TOPO_SEG_ID_FC2&in=tile:105766770,1651694&apikey=

    Documentation:

    https://demo.support.here.com/pde/layer?release=latest&url_root=pde.api.here.com&layer=TOPO_SEG_ID_FC5

    https://demo.support.here.com/pde

    https://developer.here.com/documentation/content-map-attributes/api-reference.html

    Maybe example: https://demo.support.here.com/examples/v3.1/map_attributes_along_route