具体算法介绍请点击:Python实现方式
package com.gis.launcher;
import com.gis.vo.GeoCoordinate;
import java.util.ArrayList;
import java.util.List;
/**
* Created by fc.w on 2017/12/8.
*/
public class GetCenterPointFromListOfCoordinates {
/**
* 根据输入的地点坐标计算中心点
* @param geoCoordinateList
* @return
*/
public static GeoCoordinate getCenterPoint(ListgeoCoordinateList) {
int total = geoCoordinateList.size();
double X = 0, Y = 0, Z = 0;
for (GeoCoordinate g : geoCoordinateList) {
double lat, lon, x, y, z;
lat = g.getLatitude() * Math.PI / 180;
lon = g.getLongitude() * Math.PI / 180;
x = Math.cos(lat) * Math.cos(lon);
y = Math.cos(lat) * Math.sin(lon);
z = Math.sin(lat);
X += x;