| | |
| | | using System.Collections.Generic; |
| | | using System.IO; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Web; |
| | | |
| | | namespace ExportMap.cs |
| | |
| | | string path = GetTerrainPath(args.dircode); |
| | | string json = Path.Combine(path, "layer.json"); |
| | | if (!File.Exists(json)) return null; |
| | | |
| | | Complement(args); |
| | | |
| | | List<int> ids = new List<int>(); |
| | | int pubid = InsertToDB(metas, args); |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 补充文件 |
| | | /// </summary> |
| | | private static void Complement(XYZArgs args) |
| | | { |
| | | string dirPath = GetTerrainPath(args.dircode); |
| | | string p_0_0 = Path.Combine(dirPath, "0", "0"); |
| | | if (!Directory.Exists(p_0_0)) Directory.CreateDirectory(p_0_0); |
| | | |
| | | string p_0_1 = Path.Combine(dirPath, "0", "1"); |
| | | if (!Directory.Exists(p_0_1)) Directory.CreateDirectory(p_0_1); |
| | | |
| | | |
| | | string s_0_0_0 = Path.Combine(SGUtils.LFData, "dem", "0", "0", "0.terrain"); |
| | | string d_0_0_0 = Path.Combine(dirPath, "0", "0", "0.terrain"); |
| | | File.Copy(s_0_0_0, d_0_0_0, true); |
| | | |
| | | string s_0_1_0 = Path.Combine(SGUtils.LFData, "dem", "0", "1", "0.terrain"); |
| | | string d_0_1_0 = Path.Combine(dirPath, "0", "1", "0.terrain"); |
| | | File.Copy(s_0_1_0, d_0_1_0, true); |
| | | |
| | | string layerJson = Path.Combine(dirPath, "layer.json"); |
| | | string[] lines = File.ReadAllLines(layerJson, Encoding.UTF8); |
| | | lines[12] = " [ {\"endX\":1,\"endY\":0,\"startX\":0,\"startY\":0}],[{\"endX\":3,\"endY\":1,\"startX\":2,\"startY\":1} ]"; |
| | | |
| | | File.WriteAllLines(layerJson, lines, Encoding.UTF8); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 插入数据库 |
| | | /// </summary> |
| | | private static int InsertToDB(List<SysMeta> metas, XYZArgs args) |
| | |
| | | <title></title> |
| | | <script src="js/jquery.1.12.4.js"></script> |
| | | <script> |
| | | var token = "d12b3854-17c1-46c1-8435-22b1c5892fe7"; |
| | | var token = "82e13dc3-3573-4506-9d70-02f285878bfa"; |
| | | |
| | | // Ajax |
| | | function ajax(url, type, data, dataType, contentType, fn) { |