| | |
| | | |
| | | 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?.getExceptionCenter() ?: return@forEach |
| | | |
| | | // 坐标转换 |
| | | val gcj02Point = MapUtil.wgs84ToGcj02(wgs84Lng to wgs84Lat) |
| | | val gcj02Point = MapUtil.wgs84ToGcj02(wgs84Center) |
| | | |
| | | // 查找最近场景 |
| | | var minDistance = Double.MAX_VALUE |