| | |
| | | try { |
| | | AnalysisResultEntity entity = new AnalysisResultEntity(token); |
| | | entity.setLayerName(pub.getName()); |
| | | entity.setUnit(pub.getUnit()); |
| | | |
| | | List<MetaEntity> metas = publishService.selectMetasByPubid(pub.getId()); |
| | | if (null == metas || metas.isEmpty()) { |
| | |
| | | try { |
| | | AnalysisResultEntity entity = new AnalysisResultEntity(); |
| | | entity.setLayerName(pub.getName()); |
| | | entity.setUnit(pub.getUnit()); |
| | | |
| | | List<MetaEntity> metas = publishService.selectMetasByPubid(pub.getId()); |
| | | if (null == metas || metas.isEmpty()) { |
| | |
| | | for (int j = 1; j <= bandCount; j++) { |
| | | double[] pixelValues = new double[1]; |
| | | ds.GetRasterBand(j).ReadRaster(xPixel, yPixel, 1, 1, pixelValues); |
| | | if (!Double.isNaN(pixelValues[0])) { |
| | | if (isValid(pixelValues[0])) { |
| | | vals.add(WebHelper.round(pixelValues[0], 3)); |
| | | } |
| | | } |
| | |
| | | for (Integer x : xList) { |
| | | for (Integer y : yList) { |
| | | ds.GetRasterBand(i).ReadRaster(x, y, 1, 1, pixelValues); |
| | | if (!Double.isNaN(pixelValues[0])) { |
| | | if (isValid(pixelValues[0])) { |
| | | list.add(pixelValues[0]); |
| | | } |
| | | } |
| | |
| | | |
| | | List<Double> list = new ArrayList<>(); |
| | | for (double val : pixelValues) { |
| | | if (!Double.isNaN(val)) { |
| | | if (isValid(val)) { |
| | | list.add(val); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 值是否有效 |
| | | */ |
| | | public static boolean isValid(Double val) { |
| | | return !Double.isNaN(val) && val > Integer.MIN_VALUE; |
| | | } |
| | | |
| | | /** |
| | | * 设置Band值 |
| | | */ |
| | | private void setBandVals(AnalysisResultEntity entity, List<Double> list) { |