Posted: 14 Apr 2016 9:29 EDT Last activity: 23 Aug 2016 7:52 EDT
service for implementing distance between places
i have req in my project that i have two places for example hyderabad(india) and banglore(india) when we enter the location names in the text inputs which will give the distance b/w the places using some external services like google maps or using some other services so can u plz suggest me how can we do this
Now the question is, do you want to create this service in PRPC? Or you want to use JAX-WS/RS/ Apache-CXF framework to do it from an external service running on your application server? Nevertheless look into Google map API which returns data in JSON using REST:
If you want to calculate the distance in PRPC and not have to depend on external service provider to do the calculation, you can use the latitude and longitude of the locations to plug into the Haversine formula (Haversine formula - Wikipedia, the free encyclopedia) to calculate distance. The Haversine formula does not take into account that the earth is a slightly squashed sphere, but there are formulas that do if you need the extra accuracy.