wuww
2025-04-25 9d26a531d6aaad86500e04cc750da15d292e9beb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
package com.se.nsl.controller;
 
import com.se.nsl.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 = "06-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));
    }
 
 
}