| | |
| | | ArrayList<Double> flyLatList = new ArrayList<>(); |
| | | //经度 |
| | | ArrayList<Double> flyLonList = new ArrayList<>(); |
| | | |
| | | List<HistorySecondUav> historySecondUavs = historySecondUavMapper.reList(params); |
| | | if (ObjectUtils.isEmpty(historySecondUavs)){ |
| | | return new ResultMessage(ResponseCodeEnum.TARGET_IS_NULL,"null"); |
| | | } |
| | | int ik=1; |
| | | for (HistorySecondUav historySecondUav : historySecondUavs) { |
| | | String value = historySecondUav.getValue(); |
| | | Map map1 = JSON.parseObject(value, Map.class); |
| | | flyLatList.add(Double.parseDouble(map1.get("flylat").toString())); |
| | | flyLonList.add(Double.parseDouble(map1.get("flylon").toString())); |
| | | historySecondUav.setId(ik++); |
| | | |
| | | JSONObject jsonObject = JSONObject.parseObject(value); |
| | | String flylon = jsonObject.get("flylon").toString(); |
| | | String flylat = jsonObject.get("flylat").toString(); |
| | | flyLatList.add(Double.parseDouble(flylat)); |
| | | flyLonList.add(Double.parseDouble(flylon)); |
| | | } |
| | | if (ObjectUtils.isEmpty(historySecondUavs)){ |
| | | return new ResultMessage(ResponseCodeEnum.TARGET_IS_NULL,"null"); |
| | | } |
| | | Double maxLat = Collections.max(flyLatList); |
| | | Double maxLon = Collections.max(flyLonList); |
| | | Double minLat = Collections.min(flyLatList); |
| | | Double minLon = Collections.min(flyLonList); |
| | | |
| | | //大四边形右下 |
| | | String leftTop = minLat +";"+ maxLon; |
| | | // String leftTop = minLat +";"+ maxLon; |
| | | //右上 |
| | | String rightTop = maxLat +";"+ maxLon; |
| | | // String rightTop = maxLat +";"+ maxLon; |
| | | //左下 |
| | | String leftBottom = minLat +";" + minLon; |
| | | // String leftBottom = minLat +";" + minLon; |
| | | //左上 |
| | | String rightBottom = maxLat +";" + minLon; |
| | | // String rightBottom = maxLat +";" + minLon; |
| | | //计算纬度的距离 |
| | | double distance1 = getDistance(maxLon, minLat, maxLon, maxLat); |
| | | //计算经度的距离 |
| | |
| | | ArrayList<UAVGteForDTO> list = new ArrayList<>(); |
| | | //小四边形 |
| | | |
| | | String [] lefts =new String[]{maxLon.toString(),minLat.toString()}; |
| | | // String [] lefts =new String[]{maxLon.toString(),minLat.toString()}; |
| | | //右上2 |
| | | String[] youshang = calLocationByDistanceAndLocationAndDirection(90, minLon, maxLat, 50); |
| | | String[] youshang = calLocationByDistanceAndLocationAndDirection(90, minLon, maxLat, size); |
| | | //右下2 |
| | | String[] youxia = calLocationByDistanceAndLocationAndDirection(180, Double.parseDouble(youshang[0]), Double.parseDouble(youshang[1]), 50); |
| | | String[] youxia = calLocationByDistanceAndLocationAndDirection(180, Double.parseDouble(youshang[0]), Double.parseDouble(youshang[1]), size); |
| | | //左下2 |
| | | String[] zuoxia = calLocationByDistanceAndLocationAndDirection(180, minLon, maxLat, 50); |
| | | String[] zuoxia = calLocationByDistanceAndLocationAndDirection(180, minLon, maxLat, size); |
| | | |
| | | for (int i = 0; i <distance2 ; i+=size) { |
| | | UAVGteForDTO dto1 = new UAVGteForDTO(); |
| | |
| | | O3Double = O3ArrayList.stream().mapToDouble(Double::doubleValue).average().getAsDouble(); |
| | | } |
| | | |
| | | // dto.setCoAvg(CODouble); |
| | | // dto.setNO2Avg(NODouble); |
| | | // dto.setO3Avg(O3Double); |
| | | // dto.setTVOCAvg(TVODouble); |
| | | // dto.setPM10Avg(PM10Double); |
| | | // dto.setPM25Avg(PM25Double); |
| | | // dto.setSO2Avg(SODouble); |
| | | // dto.setWDAvg(WDDouble); |
| | | // dto.setSHAvg(SHDouble); |
| | | // dto.setQYAvg(QYDouble); |
| | | dto.setA21005(CODouble); |
| | | dto.setA21004(NODouble); |
| | | dto.setA05024(O3Double); |