From 53857f42f777e2b9753b8f00cce1a60ce3dcb8fd Mon Sep 17 00:00:00 2001
From: Riku <risaku@163.com>
Date: 星期三, 15 十月 2025 22:42:29 +0800
Subject: [PATCH] 2025.10.15 修改高德地图地理逆编码结果,让地理位置信息更加详细
---
src/main/kotlin/com/flightfeather/uav/domain/entity/ExpandFun.kt | 27 ++++++++++++++++++++++-----
1 files changed, 22 insertions(+), 5 deletions(-)
diff --git a/src/main/kotlin/com/flightfeather/uav/domain/entity/ExpandFun.kt b/src/main/kotlin/com/flightfeather/uav/domain/entity/ExpandFun.kt
index 15b6b78..0fa5483 100644
--- a/src/main/kotlin/com/flightfeather/uav/domain/entity/ExpandFun.kt
+++ b/src/main/kotlin/com/flightfeather/uav/domain/entity/ExpandFun.kt
@@ -7,9 +7,6 @@
import com.flightfeather.uav.socket.bean.AirData
import com.flightfeather.uav.socket.eunm.FactorType
import com.flightfeather.uav.socket.eunm.FactorType.*
-import java.time.LocalDateTime
-import java.time.ZoneId
-import java.util.*
import kotlin.math.atan
import kotlin.math.cos
import kotlin.math.round
@@ -26,7 +23,7 @@
list.add("绾害")
val values = GsonUtils.parserJsonToArrayBeans(factors, AirData::class.java)
values.forEach {
- if (FactorType.outputFactor(it.factorName)) {
+ if (FactorType.isOutputFactor(it.factorName)) {
val name = it.factorName ?: ""
list.add(name)
// list.add("$name(鐗╃悊閲�)")
@@ -51,7 +48,7 @@
}
val values = GsonUtils.parserJsonToArrayBeans(factors, AirData::class.java)
values.forEach {
- if (FactorType.outputFactor(it.factorName)) {
+ if (FactorType.isOutputFactor(it.factorName)) {
row.add(it.factorData ?: -1.0)
// row.add(it.physicalQuantity ?: -1.0)
}
@@ -146,6 +143,26 @@
}
}
+fun GridDataDetail.getByFactorType(type: FactorType?): Float? {
+ return when (type) {
+ NO2 -> no2
+ CO -> co
+ H2S -> h2s
+ SO2 -> so2
+ O3 -> o3
+ PM25 -> pm25
+ PM10 -> pm10
+ TEMPERATURE -> temperature
+ HUMIDITY -> humidity
+ VOC -> voc
+ NOI -> noi
+ WIND_SPEED -> windSpeed
+ WIND_DIRECTION -> windDirection
+ NO -> no
+ else -> null
+ }
+}
+
fun List<GridDataDetail>.avg(): GridDataDetail {
//椋庡悜閲囩敤鍗曚綅鐭㈤噺娉曟眰鍙栧潎鍊�
var u = .0//涓滆タ鏂逛綅鍒嗛噺鎬诲拰
--
Gitblit v1.9.3