feiyu02
2025-07-29 2e024c986c14943a41f7bfe913cfef0cede64198
src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/model/PollutedArea.kt
@@ -26,6 +26,8 @@
        windLevelCondition: RTExcWindLevelConfig.WindLevelCondition?,
    ) : this() {
        distanceType = windLevelCondition?.distanceType
        distanceRange = distanceType?.disRange
        distanceDes = distanceType?.des
        windLevelCondition?.let { sourceTrace(historyData, exceptionData, config, it) }
    }
@@ -39,6 +41,9 @@
    // 污染可能的发生距离
    var distanceType: DistanceType? = null
    var distanceRange: Pair<Double, Double>? = null
    var distanceDes: String? = null
    /**
     * 反向溯源
@@ -67,13 +72,19 @@
            MapUtil.wgs84ToGcj02(it)
        }
        closePolygon = closeSourceTrace(historyData, pair)
        closePolygon = closeSourceTrace(historyData, pair).map {
            // 将坐标转换为gcj02(火星坐标系),因为污染源场景信息都为此坐标系
            MapUtil.wgs84ToGcj02(it)
        }
        try {
            val address = AMapService.reGeo(pair)
            this.address = address.district + address.township + address.street
        } catch (e: Exception) {
            e.printStackTrace()
        if (config.isSearchAddress) {
            try {
                val address = AMapService.reGeo(MapUtil.wgs84ToGcj02(pair))
                this.address = address.district + address.township + address.street
//                Thread.sleep(100)
            } catch (e: Exception) {
                e.printStackTrace()
            }
        }
    }
@@ -102,7 +113,7 @@
//            result.add(center)
            var startDeg = 0
            while (startDeg <= 360) {
                val p = MapUtil.getPointByLen(center, 50.0, startDeg * PI / 180)
                val p = MapUtil.getPointByLen(center, distanceRange.second, startDeg * PI / 180)
                result.add(p)
                startDeg++
            }
@@ -135,7 +146,7 @@
        val result = mutableListOf<Pair<Double, Double>>()
        var startDeg = 0
        while (startDeg <= 360) {
            val p = MapUtil.getPointByLen(center, 50.0, startDeg * PI / 180)
            val p = MapUtil.getPointByLen(center, DistanceType.TYPE1.disRange.second, startDeg * PI / 180)
            result.add(p)
            startDeg++
        }