riku
2021-06-21 c2a5872d4ab060e0e19a14be271a4b50d5e6059e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package com.flightfeather.uav.model.epw
 
import com.flightfeather.uav.domain.entity.Company
import com.flightfeather.uav.lightshare.bean.DataVo
import java.math.BigDecimal
 
/**
 * 工业企业污染权重分析模型
 * 根据走航监测数据,结合风速、风向、监测点与企业的相对位置等因素,计算企业对监测区域的影响程度
 * @author riku
 */
class EPWModel {
 
//    private val windDirWeight = WindDirWeight()
//    private val windDisWeight = WindDisWeight()
 
    private lateinit var datas: List<DataVo>
    private lateinit var sources: List<Company>
 
    fun execute() {
        datas.forEach d@{d ->
            if (d.lng == null || d.lng == 0.0 || d.lat == null || d.lat == 0.0) {
                return@d
            }
 
            sources.forEach s@ { s ->
                // 经纬度有效性判断
                if (s.ciLongitude == null || s.ciLongitude == BigDecimal(0) || s.ciLatitude == null || s.ciLatitude == BigDecimal(0)) {
                    return@s
                }
 
                val p1 = Pair(d.lng!!, d.lat!!)
                val p2 = Pair(s.ciLongitude.toDouble(), s.ciLatitude.toDouble())
//                windDirWeight.getWeight(p1, p2)
            }
        }
    }
}