Find center geopoint between start geo point and end geo point on android

后端 未结 3 1205
梦如初夏
梦如初夏 2020-12-11 19:05

I have start latitude, longitude and end latitude,longitude.

I find Geo Point using latitude and longitude.

After that i draw line between the two Geo points

3条回答
  •  没有蜡笔的小新
    2020-12-11 19:41

    You can approximate the midpoint by taking the average of the latitudes of the two points and the average of the longitudes.

    If you need it a bit more precisely, you can use the Haversine formula and some algebra to derive the midpoint.

提交回复
热议问题