1
13693261870
2022-10-11 a034f7f703dc0328858c0fbcdcf19031d9d9152f
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
using Community.Model.Calc;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
 
namespace Community.cs
{
    public class CalcVolume
    {
        public static readonly string BaseDir = System.AppDomain.CurrentDomain.BaseDirectory;
 
        public static List<Triangle> GetPoints(string type, string wkt)
        {
            string fileName = string.Format("files\\hbks_up{0}.shp", type);
            string shp = Path.Combine(BaseDir, fileName);
            if (!File.Exists(shp))
            {
                return null;
            }
 
            GdalOp op = new GdalOp();
            List<Triangle> list = op.ReadShp(shp, wkt);
            if (list == null || list.Count == 0)
            {
                return null;
            }
 
            string tif_up = Path.Combine(BaseDir, "tif\\hbks_up02.tif");
            if (File.Exists(tif_up))
            {
                op.ReadTif(tif_up, list, "Z1");
            }
 
            string tif_down = Path.Combine(BaseDir, "tif\\hbks_down02.tif");
            if (File.Exists(tif_down))
            {
                op.ReadTif(tif_down, list, "Z2");
            }
 
            return list;
        }
    }
}