zhangk
2024-06-22 3570bc18d5daed8079dd67891062ad8585a4e696
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/service/impl/AttResBaseServiceImpl.java
@@ -146,6 +146,7 @@
         throw new ServiceException("转换降雨栅格数据失败,详情:" + e.getMessage());
      }
      RainfallGridData.Data data = gridData.getData();
      String fileName = data.getFileName();
      RainfallGridData.GridInfo gridInfo = data.getGridInfo();
      List<List<Double>> gridDataList = data.getGridData();
      if (gridDataList == null || gridDataList.isEmpty()) {
@@ -176,6 +177,10 @@
       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):(站点的纬度 - 网格最小纬度) / 每个网格单元的纬度跨度
@@ -193,9 +198,10 @@
            AttResWithRainfall attResWithRainfall = new AttResWithRainfall();
            BeanUtil.copyProperties(attResBase, attResWithRainfall);
            attResWithRainfall.setRainfall(String.valueOf(rainfall));
            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());
         }
      }