1

I'm looking to calculate the latitude and longitude of where to place a marker that is a specific distance and direction from a known position's latitude and longitude. This is for an Android app (in Java) using the HERE mapping API.

jrisch
  • 132
  • 1
  • 9
  • I have found a solution at [https://stackoverflow.com/questions/10119479/calculating-lat-and-long-from-bearing-and-distance](https://stackoverflow.com/questions/10119479/calculating-lat-and-long-from-bearing-and-distance) – jrisch Oct 10 '19 at 16:33

1 Answers1

1

Our Android Mobile SDK (Java) currently supports calculating distance between two geocoordinates (lat, lon) via the distanceTo method of the Geocoordinate class.

https://developer.here.com/documentation/android-premium/api_reference_java/index.html

The method you are requesting is currently not provided. However, our JavaScript SDK provides a walk method of the H.geo.Point class. This method returns the destination point, based on the given distance and bearing relative to the current point.

https://developer.here.com/documentation/maps/topics_api/h-geo-point.html#h-geo-point__walk

The algorithm is based on the Haversine formula and so you can also use the formula to calculate the target point yourself.

  • Thank you, HERE Developer Support, a bit odd that you have the capability in the Javascript SDK but not the Android (Java) one. However I have found a solution (see above). – jrisch Oct 10 '19 at 16:31