| | |
| | | package com.se.simu.service; |
| | | |
| | | import cn.hutool.core.io.FileUtil; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.se.simu.config.PropertiesConfig; |
| | | import com.se.simu.domain.dto.LayerDto; |
| | | import com.se.simu.domain.dto.ResultDto; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.BufferedWriter; |
| | | import java.io.File; |
| | | import java.io.FileWriter; |
| | | import java.io.IOException; |
| | | |
| | | /** |
| | | * 处理结果服务类 |
| | |
| | | |
| | | public final static double MAX_X_OFFSET = 0.002; |
| | | |
| | | public void process(ResultDto dto) { |
| | | public void process(ResultDto dto) throws Exception { |
| | | try { |
| | | LayerDto layer = new LayerDto(config.getVer()); |
| | | |
| | |
| | | // |
| | | } |
| | | |
| | | private void copeLayerJson(ResultDto dto, LayerDto layer) { |
| | | // |
| | | private void copeLayerJson(ResultDto dto, LayerDto layer) throws IOException { |
| | | String json = JSONUtil.toJsonPrettyStr(layer); |
| | | String filePath = dto.getOutPath() + File.separator + "layer.json"; |
| | | |
| | | FileWriter fw = new FileWriter(filePath); |
| | | BufferedWriter bw = new BufferedWriter(fw); |
| | | bw.write(json); |
| | | bw.close(); |
| | | fw.close(); |
| | | } |
| | | |
| | | public String test() { |
| | | public String test() throws Exception { |
| | | ResultDto dto = new ResultDto( |
| | | "202409", |
| | | "D:\\simu\\input\\tongzhou-local-mesh2-terrain.tif", |