依赖
<dependency>
<groupId>com.mapbox.mapboxsdk</groupId>
<artifactId>mapbox-sdk-turf</artifactId>
<version>5.6.0</version>
</dependency>
算法
public class FxTbLngLat implements Serializable {
@EntityDescription(value = "图元类型")
private String type;
@EntityDescription(value = "经度")
private double lng;
@EntityDescription(value = "纬度")
private double lat;
@EntityDescription(value = "经纬度集合")
private String shape;
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public double getLng() {
return lng;
}
public void setLng(double lng) {
this.lng = lng;
}
public double getLat() {
return lat;
}
public void setLat(double lat) {
this.lat = lat;
}
public String getShape() {
return shape;
}
public void setShape(String shape) {
this.shape = shape;
}
}
public static Double getDistDoublePoint(FxTbLngLat point1, FxTbLngLat point2) {
Point fromPt = Point.fromLngLat(point1.getLng(), point1.getLat());
Point toPt = Point.fromLngLat(point2.getLng(