| | |
| | | List<Map<String, Object>> fiveMinuteDataList = historyFiveMinutelyService.getFiveMinutesDataByMacsAndTimeSolt(pa); |
| | | //声明数组,存放所有设备的数值 |
| | | double[] allDeviceData = new double[fiveMinuteDataList.size()]; |
| | | System.out.println(fiveMinuteDataList); |
| | | int i = 0; |
| | | //计算风向 |
| | | List<Map<String,Object>> windList = new ArrayList<>(); |
| | |
| | | i = i+1; |
| | | } |
| | | //计算平均风向和风速 |
| | | System.out.println("windList:"+windList); |
| | | Map<String,Double> res = WindUtils.getWind_direction_speed(windList); |
| | | System.out.println("res:"+res); |
| | | //计算该站点的点与污染源点的角度 |
| | | Map<String,Double> angleMap = new HashMap(); |
| | | MyLatLng pollutionSourcePoint_log_lat = new MyLatLng(pollutionSourcePoint.getLongitude(),pollutionSourcePoint.getLatitude()); |
| | |
| | | double deviceDataAvg = sum/allDeviceData.length; |
| | | //计算污染源点与设备点之间的距离 |
| | | double distance = mapUtils.getDistance(pollutionSourcePoint.getLongitude(),pollutionSourcePoint.getLatitude(),referenceDevice.getLongitude(),referenceDevice.getLatitude()); |
| | | System.out.println("distance:"+distance); |
| | | //已知距离,角度,求x,y |
| | | System.out.println(minDisparity.get().getValue()); |
| | | double x = Math.cos(Math.toRadians(minDisparity.get().getValue()))*distance; |
| | | System.out.println("三角函数:"+Math.cos(minDisparity.get().getValue())); |
| | | System.out.println(x); |
| | | double y = Math.sin(Math.toRadians(minDisparity.get().getValue()))*distance; |
| | | //获取设备的数值 |
| | | String[] fiveMinuteData = fiveMinuteDataMap.get(sensorKey).toString().split(","); |
| | | double c = Double.parseDouble(fiveMinuteData[0].substring(1,fiveMinuteData[0].length()))-deviceDataAvg; |
| | | System.out.println(c); |
| | | //计算源强 |
| | | double pollutionSourceIntensity = EmissionDataUtil.getPollutionSourceIntensity(c,x,y,res.get("wind_speed")); |
| | | System.out.println("c:"+c); |
| | | System.out.println("x:"+x); |
| | | System.out.println("y:"+y); |
| | | System.out.println("风速:"+res.get("wind_speed")); |
| | | System.out.println(pollutionSourceIntensity); |
| | | |
| | | //存放地图中心点 |
| | | Map<String,Object> center = new HashMap<>(); |
| | |
| | | numericalValueMap7.put("lat",31.450588); |
| | | numericalValueMap7.put("count",0.10); |
| | | numericalValueList.add(numericalValueMap7); |
| | | System.out.println(numericalValueList.toString()); |
| | | |
| | | |
| | | JSONObject params = new JSONObject(); |