管道基础大数据平台系统开发-【CS】-ExportMap
11
13693261870
2024-09-03 e05f48fc7ba368d3561d8702b18d65ee021b1ae2
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>Export</title>
  <meta http-equiv="Expires" content="0" />
  <meta http-equiv="Cache" content="no-cache" />
  <meta http-equiv="Pragma" content="no-cache" />
  <meta http-equiv="Cache-control" content="no-cache" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <script src="js/jquery.1.12.4.js"></script>
  <script>
    var token = "b2657209-38ab-4ce3-af63-e2740bbd9f68";
 
    $(function () {
      $("#token").html(token);
    });
 
    // Ajax
    function ajax(url, type, data, dataType, contentType, fn) {
      $.ajax({
        url: url,
        type: type,
        data: data,
        dataType: dataType || "json", // html、json、jsonp、script、text
        contentType: contentType || "application/json", // "application/x-www-form-urlencoded"
        success: function (data) {
          fn(data);
        },
        error: function (e) {
          console.error(e);
          fn();
        }
      });
    }
 
    // 出图-1
    function exportMap1() {
      var page = $("#selectPage").find("option:selected").text();
      var data = {
        token: token,
        title: "管道基础大数据平台(DW1-01)",
        pageSize: page,
        province: "河北省",
        scale: "1:5万",
        resolution: "5米",
        date: "2022.11.09",
        layers: "m_hydraulic_protection,m_marker,m_pipeline,m_sitepoint,m_valvehousepoint,m_crossing,高德矢量",
        rotation: 0,
        xmin: 103.394023,
        ymin: 30.690466,
        ymax: 37.871048,
        xmax: 112.534648
      };
 
      ajax("http://127.0.0.1/ExportMap/Export/Start", "POST", JSON.stringify(data), null, null, function (rs) {
        alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result);
        console.log(rs);
      });
    }
 
    // 出图-2
    function exportMap2() {
      var page = $("#selectPage").find("option:selected").text();
      var data = {
        token: token,
        title: "管道基础大数据平台(DW1-02)",
        pageSize: page,
        province: "山东省",
        scale: "1:1万",
        resolution: "2米",
        date: "2022.11.10",
        layers: "bs_project,th_strategic_channel,m_hydraulic_protection,m_marker,m_pipeline,m_sitepoint,m_valvehousepoint,m_crossing,高德影像",
        rotation: 0,
        xmin: 103.394023,
        ymin: 30.690466,
        ymax: 37.871048,
        xmax: 112.534648
      };
 
      ajax("Export/Start", "POST", JSON.stringify(data), null, null, function (rs) {
        alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result);
        console.log(rs);
      });
    }
 
    // 测试切图
    function convertXYZ() {
      var data = { token: token, ids: [1217], id: 1, min: 4, max: 17, depcode: "00", dircode: "0B", userId: 1, name: "5_A1", noData: 255 };
      ajax("Convert/ToTiles", "POST", JSON.stringify(data), null, null, function (rs) {
        alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result);
        console.log(rs);
      });
    }
 
    // 测试Rvt *
    function convert1() {
      var data = { token: token, ids: [1521], depcode: "000305", dircode: "0102", userId: 1 };
      ajax("Convert/ToTileset", "POST", JSON.stringify(data), null, null, function (rs) {
        alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result);
        console.log(rs);
      });
    }
 
    // 测试Fbx
    function convert2() {
      var data = { token: token, ids: [8362], depcode: "000305", dircode: "0102", userId: 1 };
      ajax("Convert/ToTileset", "POST", JSON.stringify(data), null, null, function (rs) {
        alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result);
        console.log(rs);
      });
    }
 
    // 测试Ifc
    function convert3() {
      var data = { token: token, ids: [7615], depcode: "000305", dircode: "0A040001010004", userId: 1 };
      ajax("Convert/ToTileset", "POST", JSON.stringify(data), null, null, function (rs) {
        alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result);
        console.log(rs);
      });
    }
 
    // 测试SG
    function toSG() {
      var data = { token: token, ids: [10516], depcode: "000305", dircode: "0102", userId: 1 };
      ajax("Convert/ToSG", "POST", JSON.stringify(data), null, null, function (rs) {
        alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result);
        console.log(rs);
      });
    }
    
    // 测试Terra:10526,10527 | 10531
    function toTerra() {
      var data = { token: token, ids: [1413, 1412], min: 0, max: 18, depcode: "00", dircode: "0B", userId: 1, name: "川二" };
      ajax("Convert/ToTerra", "POST", JSON.stringify(data), null, null, function (rs) {
        alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result);
        console.log(rs);
      });
    }
 
    // 测试OSGB
    function toOsgb() {
      var data = { token: token, ids: [10287], depcode: "00", dircode: "0C", userId: 1, name: "3-1倾斜模型-中卫站", zs: [0] };
      ajax("Convert/ToOsgb", "POST", JSON.stringify(data), null, null, function (rs) {
        alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result);
        console.log(rs);
      });
    }
 
    // LasByPy
    function toLasByPy() {
      var data = { token: token, ids: [7188], depcode: "00", dircode: "0C", userId: 1, name: "HL_point_cloud_part_1.las", srids: [4548], zs: [0] };
      ajax("Convert/ToLasByPy", "POST", JSON.stringify(data), null, null, function (rs) {
        alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result);
        console.log(rs);
      });
    }
 
    // 测试Las
    function toLas() {
      var data = { token: token, ids: [10481], depcode: "00", dircode: "0C", userId: 1, name: "HL_point_cloud_part_1.las", srids: [4548], zs: [0] };
      ajax("Convert/ToLas", "POST", JSON.stringify(data), null, null, function (rs) {
        alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result);
        console.log(rs);
      });
    }
 
    // 测试Laz
    function toLaz(){
      var data = { token: token, ids: [10285], depcode: "00", dircode: "0C", userId: 1, name: "577.laz", srids: [4548], zs: [0] };
      ajax("Convert/ToLas", "POST", JSON.stringify(data), null, null, function (rs) {
        alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result);
        console.log(rs);
      });
    }
 
    // 生成Mpt
    function createMpt() {
      ajax("TB/CreateMpt" + "?token=" + token + "&path=" + encodeURIComponent("D:\\LF\\data\\ANTU\\"), "GET", null, null, null, function (rs) {
        alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result);
        console.log(rs);
      });
    }
 
    // 读取Las坐标系
    function ReadLasCs() {
      var data = { token: token, ids: [10483, 10481, 10456, 10285], dircode: "00" };
      ajax("Convert/ReadLasCs", "POST", JSON.stringify(data), null, null, function (rs) {
        alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result);
        console.log(rs);
      });
    }
 
    // 结束任务
    function deleteTask() {
      var data = { token: token, ids: [$("#taskId").val()], dircode: "00" };
      ajax("Convert/DeleteTask", "POST", JSON.stringify(data), null, null, function (rs) {
        alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result);
        console.log(rs);
      });
    }
  </script>
</head>
<body>
  <h2>Toekn:<span id="token" style="font-size: 14px;"></span></h2>
  <select id="selectPage">
    <option>A0</option>
    <option>A1</option>
    <option>A2</option>
    <option>A3</option>
    <option selected="selected">A4</option>
  </select>
  <input type="button" value="出图-1" onclick="exportMap1()" />
  <input type="button" value="出图-2" onclick="exportMap2()" />
  <a href="Convert/Test">Test</a>
  <br /><br />
  
  <input type="button" value="测试切图" onclick="convertXYZ();" />
  <input type="button" value="测试Rvt" onclick="convert1();" />
  <input type="button" value="测试Fbx" onclick="convert2();" />
  <input type="button" value="测试Ifc" onclick="convert3();" />
  <input type="button" value="测试SG" onclick="toSG();" />
  <input type="button" value="测试Terra" onclick="toTerra();" />
  <input type="button" value="测试OSGB" onclick="toOsgb();" />
  <input type="button" value="LasByPy" onclick="toLasByPy();" />
  <input type="button" value="测试Las" onclick="toLas();" />
  <input type="button" value="测试Laz" onclick="toLaz();" />
  <input type="button" value="生成Mpt" onclick="createMpt();" />
  <br /><br />
  
  <input type="button" value="读取Las坐标系" onclick="ReadLasCs();" />
  <input id="taskId" value="0" />
  <input type="button" value="结束任务" onclick="deleteTask();" />
</body>
</html>