| | |
| | | import com.se.simu.domain.po.DataPo; |
| | | import com.se.simu.domain.vo.BuildingDepthVo; |
| | | import com.se.simu.helper.GdalHelper; |
| | | import com.se.simu.helper.ShpHelper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.gdal.gdal.Band; |
| | | import org.gdal.gdal.Dataset; |
| | |
| | | |
| | | createWaterPng(dto, ds, layer, layer.getWaters().getData().get(i)); |
| | | copyWaterTif(dto, ds, layer.getWaters().getData().get(i)); |
| | | createVectorShp(dto, ds, layer, layer.getWaters().getData().get(i)); |
| | | } finally { |
| | | if (null != ds) ds.delete(); |
| | | } |
| | |
| | | String png = waterPath + File.separator + sizes[0] + "_" + sizes[1] + ".png"; |
| | | water2Png(dto, layer, tif, png, sizes[0], sizes[1]); |
| | | } |
| | | } |
| | | |
| | | private static void copyWaterTif(ResultDto dto, Dataset ds, long ticks) { |
| | | String source = ds.GetDescription(); |
| | | String target = dto.getOutPath() + File.separator + "waters" + File.separator + ticks + File.separator + "water.tif"; |
| | | FileUtil.copyFile(source, target); |
| | | } |
| | | |
| | | private static String getNameWithExt(String file) { |
| | |
| | | return !Double.isNaN(val) && val > Integer.MIN_VALUE; |
| | | } |
| | | |
| | | private static void copyWaterTif(ResultDto dto, Dataset ds, long ticks) { |
| | | String source = ds.GetDescription(); |
| | | String target = dto.getOutPath() + File.separator + "waters" + File.separator + ticks + File.separator + "water.tif"; |
| | | FileUtil.copyFile(source, target); |
| | | } |
| | | |
| | | private static void createVectorShp(ResultDto dto, Dataset ds, LayerDto layer, Long ticks) { |
| | | String shpFile = dto.getOutPath() + File.separator + "waters" + File.separator + ticks + File.separator + "water.shp"; |
| | | ShpHelper.polygonize(ds, shpFile); |
| | | } |
| | | |
| | | private void copeFlow(ResultDto dto, LayerDto layer) { |
| | | List<String> files = getFiles(dto.getFlowPath(), ".tif"); |
| | | if (null == files || files.size() != layer.getWaters().getData().size()) return; |