0

I want to get the nearest location of predefined locations to the start location.

for example : Post https://geocode.search.hereapi.com/v1/ geocode

Body:

{
from:{
counrtyCode:"US",
city:"NewYouk",
Postcode:"55555"
},
to:[
{
counrtyCode:"US",
city:"NewYouk",
Postcode:"66666"
},
{
counrtyCode:"US",
city:"NewYouk",
Postcode:"77777"
}
]

I want to check which one in the TO List is the nearest to The FROM location. Do we have something like this in HERE Rest API ?

1 Answers1

0

you can do something like geocoordinate1.distanceTo(geocoordinate2) to get the distance between any two geocoordinates and do this for a list of geocoordinates and take the least one.

Shambhu
  • 11
  • 1