feiyu02
2025-12-25 d649f734c44541641158aec2d6b10d630f5a0827
src/main/kotlin/com/flightfeather/uav/biz/report/MissionRiskArea.kt
@@ -3,7 +3,6 @@
import com.flightfeather.uav.biz.sourcetrace.model.PollutedClue
import com.flightfeather.uav.common.utils.MapUtil
import com.flightfeather.uav.domain.entity.SceneInfo
import com.flightfeather.uav.domain.entity.avg
import com.flightfeather.uav.socket.eunm.AggregatedFactorType
import com.flightfeather.uav.socket.eunm.FactorType
@@ -56,16 +55,11 @@
        
        pollutedClues.forEach { pollutedClue ->
            if (pollutedClue == null) return@forEach
            val dataList = pollutedClue.pollutedData?.dataList ?: emptyList()
            if (dataList.isEmpty()) return@forEach
            // 计算单个PollutedClue的均值经纬度
            val avgData = dataList.avg()
            val wgs84Lng = avgData.longitude?.toDouble() ?: return@forEach
            val wgs84Lat = avgData.latitude?.toDouble() ?: return@forEach
            val wgs84Center = pollutedClue.pollutedData?.exceptionCenter() ?: return@forEach
            // 坐标转换
            val gcj02Point = MapUtil.wgs84ToGcj02(wgs84Lng to wgs84Lat)
            val gcj02Point = MapUtil.wgs84ToGcj02(wgs84Center)
            
            // 查找最近场景
            var minDistance = Double.MAX_VALUE