How to avoid matching waypoint (origination/destination) to highway?

How to avoid matching waypoint (origination/destination) to highway?

When a waypoint is very closed to highway, it's highly possible that routing API matches to highway, sometimes this behavior makes confusions since origination is actually not on the highway.

For example, this location (14.5395,121.01717), it's a bit closer to highway, but it could be on the surface road as well.



And using this point as origination, the routing API will match it to highway, as the image below:



How to change the behavior if it's not desired? There is an attribute can be used to avoid matching to highway: onRoadThreshold. Simply adding this to the waypoint, such as:

https://router.hereapi.com/v8/routes?apikey=DEFAULT_API_KEY&origin=14.5395,121.01717;onRoadThreshold=0&destination=14.5385084,121.0109481&return=polyline,summary,actions,instructions&transportMode=car

onRoadThreshold=0 means "NEVER matching to highway". The value of threshold can be adjusted according to user's preference, for example, onRoadThreshold=5 means "Do not match to highway unless it's within 5 meters range."



Ref: HERE Routing API Reference Client