| | |
| | | List<AttResWithRainfall> attResWithRainfallList = new ArrayList<>(); |
| | | |
| | | for (AttResBase attResBase : attResBases) { |
| | | if (null == attResBase.getCenterLat() || attResBase.getCenterLong() == null) { |
| | | log.warn("过滤掉经度或者纬度为空的水库,水库名称:{}", attResBase.getName()); |
| | | continue; |
| | | } |
| | | // 横向索引(lonIndex):(站点的经度 - 网格最小经度) / 每个网格单元的经度跨度 |
| | | int lonIndex = (int) ((Double.parseDouble(attResBase.getCenterLong()) - lonMin) / lonSpan); |
| | | // 纵向索引(latIndex):(站点的纬度 - 网格最小纬度) / 每个网格单元的纬度跨度 |
| | |
| | | attResWithRainfall.setFileName(fileName); |
| | | attResWithRainfallList.add(attResWithRainfall); |
| | | } else { |
| | | log.warn("AttRes {} is out of the grid range. centerLong: {}, centerLat: {}", attResBase.getName(), |
| | | log.warn("水库 {} 超出栅格范围. 中心点经度: {}, 中心点纬度: {}", attResBase.getName(), |
| | | attResBase.getCenterLong(), attResBase.getCenterLat()); |
| | | } |
| | | } |