how to find the distance between two geopoints?

后端 未结 6 1900
遇见更好的自我
遇见更好的自我 2020-12-06 01:55
double distance;  

Location locationA = new Location(\"point A\");  

locationA.setLatitude(latA);  
locationA.setLongitude(lngA);  

Location locationB = new Locat         


        
6条回答
  •  执念已碎
    2020-12-06 02:14

    Try Location.distanceBetween(..)

    Update:

    If you are getting lat/lon from GeoPoint then they are in microdegrees. You must multiply by 1e6.

提交回复
热议问题