| | |
| | | package com.ruoyi.utils.tube; |
| | | |
| | | import com.ruoyi.alarmpoints.tube.domain.ArdTubesDetails; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.gavaghan.geodesy.Ellipsoid; |
| | | import org.gavaghan.geodesy.GeodeticCalculator; |
| | |
| | | } |
| | | |
| | | /** |
| | | * @描述 计算坐标 |
| | | * @参数 [ardTubesDetails, alarmPointDistance] |
| | | * @返回值 void |
| | | * @创建人 刘苏义 |
| | | * @创建时间 2023/6/8 14:38 |
| | | * @修改人和其它信息 |
| | | * 计算坐标 |
| | | * |
| | | * 刘苏义 |
| | | * 2023/6/8 14:38 |
| | | */ |
| | | public static GeoPoint CalculateCoordinates(List<ArdTubesDetails> ardTubesDetails, Integer alarmPointDistance) { |
| | | try { |
| | | if(StringUtils.isNull(alarmPointDistance)) |
| | | { |
| | | log.debug("报警点距离为空,无法计算坐标"); |
| | | return null; |
| | | } |
| | | Comparator<ArdTubesDetails> comparator = Comparator.comparingInt(person -> Integer.parseInt(person.getInflectionPointNumber())); // 使用Collections.sort方法进行排序 |
| | | Collections.sort(ardTubesDetails, comparator); |
| | | GeoPoint point0 = new GeoPoint(ardTubesDetails.get(0).getLongitude(), ardTubesDetails.get(0).getLatitude(), ardTubesDetails.get(0).getAltitude() - ardTubesDetails.get(0).getDepth()); |