[ 
https://issues.apache.org/jira/browse/OFBIZ-11901?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17162577#comment-17162577
 ] 

Ravi Lodhi commented on OFBIZ-11901:
------------------------------------

+1 [~surajk] ,

The great circle method can be chosen for this. First, convert the latitude and 
longitude values from decimal degrees to radians and then using the formula 
given below, the distance between two geo points can be calculated easily.
{code:java}
Formula: 
Earth radius, r = 3963 //in miles 
//or
Earth radius, r = 6378.8 // in kilometers

Distance, d = 3963.0 * arccos[(sin(fromLatitude) * sin(toLatitude)) + 
cos(fromLatitude) * cos(toLatitude) * cos(toLongitude – fromLongitude)]{code}
 

> Provide OOTB support to calculate distance between two geo points
> -----------------------------------------------------------------
>
>                 Key: OFBIZ-11901
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-11901
>             Project: OFBiz
>          Issue Type: New Feature
>    Affects Versions: Trunk
>            Reporter: Suraj Khurana
>            Assignee: Suraj Khurana
>            Priority: Major
>
> Though there are many third party capabilities available in the form of 
> API's, this can easily be calculated within OFBiz as well.
> This method will be providing direct spatial distance between two geo points.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to