管道基础大数据平台系统开发-【CS】-ExportMap
13693261870
2024-07-18 0f522b742699f0d81f23adc4cf517205cdf3d45c
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
using Newtonsoft.Json;
using SimuTools.Domain;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace SimuTools.Tools
{
    public class Handle
    {
        public static readonly string BaseDir = AppDomain.CurrentDomain.BaseDirectory;
 
        public static void Run(string terrainFile, string waterPath, string flowPath, string outPath)
        {
            Layer layer = new Layer();
            layer.terrain = new Terrain();
            layer.duration = new Duration(1719812810225L, 1719812810225L);
            layer.extension = new Extension();
            layer.waters = new Water();
 
            CreateLayerJson(outPath, layer);
        }
 
        private static void CreateLayerJson(string outPath, Layer layer)
        {
            if (null == layer) return;
 
            String json = JsonConvert.SerializeObject(layer);
 
            string filePath = Path.Combine(outPath, "layer.json");
            using (StreamWriter sw = new StreamWriter(filePath))
            {
                sw.Write(json);
            }
        }
    }
}