package com.se.simu.controller;
|
|
import com.se.simu.service.SemFilesSimuService;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiOperation;
|
import lombok.RequiredArgsConstructor;
|
import org.springframework.http.ResponseEntity;
|
import org.springframework.web.bind.annotation.*;
|
|
import javax.annotation.Resource;
|
|
/**
|
* SEM 文件 SIMU 控制器
|
*
|
* @author xingjinshuang@smartearth.cn
|
* @date 2024/12/30
|
*/
|
@Api(tags = "SEM相关接口")
|
@CrossOrigin(origins = "*")
|
@RequiredArgsConstructor
|
@RestController
|
@RequestMapping("/api/v1/sem")
|
public class SemFilesSimuController {
|
|
@Resource
|
private SemFilesSimuService semFilesSimuService;
|
|
|
/**
|
* 获取 INTRODUCE
|
* 1、动态数据存储在DYNZAMIZERS表中,其中:
|
* url:数据url
|
* data:zarr数据,使用的是zarr的压缩存储格式。详见zarr的zipstore。
|
* gmlId:与实体对象相关联字段(使用ENTITY表(实体表)中的UUID相关联)
|
* <p>
|
* zarr数据结构示例:
|
* Grid相关的zarr:
|
* /
|
* |——depth (n,height,width)
|
* |——time(n)
|
* <p>
|
* time存储时间序列
|
* depth存储水深相关信息,三维数组,第一维为时间 与time相对应
|
* 数组长度n代表时间切片的个数
|
* height,width代表栅格的长和宽
|
* <p>
|
* 降雨量相关zarr:
|
* /
|
* |——rainfall(n)
|
* |——time(n)
|
* <p>
|
* time存储时间序列
|
* rainfall 存储降雨量相关信息,一维数组,与time相对应
|
* 数组长度n代表时间切片的个数
|
* <p>
|
* <p>
|
* 2、terrain的存储方式:
|
* 类型为”+Terrain“
|
* Entity中几何存储地形的外包框,使用纹理贴图存储地形tif转出的png图片。
|
*
|
* @return {@link ResponseEntity}<{@link Object}>
|
* @throws Exception
|
*/
|
@ApiOperation("0-sem介绍")
|
@GetMapping("/introduce")
|
public ResponseEntity<Object> getIntroduce() throws Exception {
|
return ResponseEntity.ok(semFilesSimuService.getIntroduce());
|
}
|
|
|
/**
|
* sem文件创建模拟
|
*/
|
@ApiOperation("1-sem文件创建模拟")
|
@PostMapping("/create")
|
public ResponseEntity<Object> createSimuBySemFile() throws Exception {
|
return ResponseEntity.ok(semFilesSimuService.createSimuBySemFile());
|
}
|
|
/**
|
* sem文件读取模拟
|
*/
|
@ApiOperation("2-sem文件读取模拟")
|
@ApiImplicitParam(name = "filePath", value = "文件地址", required = true, dataType = "String", paramType = "query", example = "D:\\app\\simulation\\other\\1211SEM样例\\管点.sem", dataTypeClass = String.class)
|
@PostMapping("/read")
|
public ResponseEntity<Object> readSemFile(@RequestParam("filePath") String filePath) throws Exception {
|
return ResponseEntity.ok(semFilesSimuService.readSemFile(filePath));
|
}
|
|
|
}
|