From 11dd7f1b1c7288ed8aefae60e9c43647c61ce4af Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期一, 17 七月 2023 16:04:17 +0800 Subject: [PATCH] 1 --- ExportMap/cs/OsgbUtils.cs | 3 ++- ExportMap/Controllers/ConvertController.cs | 3 +++ ExportMap/Models/XYZArgs.cs | 3 ++- ExportMap/export.html | 6 +++--- ExportMap/Web.config | 4 ++-- ExportMap/cs/LasUtils.cs | 2 +- 6 files changed, 13 insertions(+), 8 deletions(-) diff --git a/ExportMap/Controllers/ConvertController.cs b/ExportMap/Controllers/ConvertController.cs index 7a2902f..229da19 100644 --- a/ExportMap/Controllers/ConvertController.cs +++ b/ExportMap/Controllers/ConvertController.cs @@ -144,6 +144,7 @@ if (null != msg) return msg; if (args.srids.Count != args.ids.Count) return ResponseMsg<string>.fail("鍧愭爣绯籌D闆嗗悎涓庡厓鏁版嵁ID闆嗗悎闀垮害涓嶄竴鑷�"); + if (args.zs.Count != args.ids.Count) return ResponseMsg<string>.fail("楂樺害鍋忕Щ閲忛泦鍚堜笌鍏冩暟鎹甀D闆嗗悎闀垮害涓嶄竴鑷�"); string err = null; List<int> rs = LasUtils.Generate(args, ref err); @@ -172,6 +173,8 @@ ResponseMsg<string> msg = checkArgs(args); if (null != msg) return msg; + if (args.zs.Count != args.ids.Count) return ResponseMsg<string>.fail("楂樺害鍋忕Щ閲忛泦鍚堜笌鍏冩暟鎹甀D闆嗗悎闀垮害涓嶄竴鑷�"); + string err = null; List<int> rs = OsgbUtils.Generate(args, ref err); if (null == rs || rs.Count == 0) diff --git a/ExportMap/Models/XYZArgs.cs b/ExportMap/Models/XYZArgs.cs index 6c445dc..c12d340 100644 --- a/ExportMap/Models/XYZArgs.cs +++ b/ExportMap/Models/XYZArgs.cs @@ -13,6 +13,7 @@ public XYZArgs() { srids = new List<int>(); + zs = new List<double>(); ids = new List<int>(); isNew = true; } @@ -80,6 +81,6 @@ /// <summary> /// 楂樺害鍋忕Щ閲� /// </summary> - public double z { set; get; } + public List<double> zs { set; get; } } } diff --git a/ExportMap/Web.config b/ExportMap/Web.config index d81eaa2..0fa81f8 100644 --- a/ExportMap/Web.config +++ b/ExportMap/Web.config @@ -21,8 +21,8 @@ <!-- Mpt璺緞 --> <add key="mpt" value="D:\LF\data\mpt\tb.mpt" /> <!-- PG杩炴帴 --> - <add key="pgConn" value="Server=127.0.0.1;Port=5433;Database=langfang;User Id=postgres;Password=postgres;"/> - <!--<add key="pgConn" value="Server=192.168.20.205;Port=5433;Database=langfang;User Id=postgres;Password=Postgres!_14_Lf;"/>--> + <!--<add key="pgConn" value="Server=127.0.0.1;Port=5433;Database=langfang;User Id=postgres;Password=postgres;"/>--> + <add key="pgConn" value="Server=192.168.20.205;Port=5433;Database=langfang;User Id=postgres;Password=Postgres!_14_Lf;"/> <!--<add key="pgConn" value="Server=103.85.165.99;Port=5433;Database=langfang;User Id=postgres;Password=Postgres!_14_Lf;"/>--> <add key="webpages:Version" value="3.0.0.0"/> <add key="webpages:Enabled" value="false"/> diff --git a/ExportMap/cs/LasUtils.cs b/ExportMap/cs/LasUtils.cs index 921af5e..5f38402 100644 --- a/ExportMap/cs/LasUtils.cs +++ b/ExportMap/cs/LasUtils.cs @@ -56,7 +56,7 @@ if ("laz" == meta.type) lasPath = toLas(lasPath, Path.Combine(outPath, meta.id + ".las")); int idx = args.ids.IndexOf(meta.id); - string cmd = string.Format("{0}\\gocesiumtiler.exe -i \"{1}\" -o \"{2}\" -e {3} -z {4} -g -s", tilerPath, lasPath, outPath, args.srids[idx], args.z); + string cmd = string.Format("{0}\\gocesiumtiler.exe -i \"{1}\" -o \"{2}\" -e {3} -z {4} -g -s", tilerPath, lasPath, outPath, args.srids[idx], args.zs[idx]); err = Tools.ExecCmd(cmd, false, false); string jsonFile = findTileset(meta, outPath); diff --git a/ExportMap/cs/OsgbUtils.cs b/ExportMap/cs/OsgbUtils.cs index cc2c57e..802b2d2 100644 --- a/ExportMap/cs/OsgbUtils.cs +++ b/ExportMap/cs/OsgbUtils.cs @@ -59,7 +59,8 @@ string srs = findSRS(osgbPath); if (null != srs) writeSRS(osgbPath, getSRS(srs)); - string cmd = string.Format("{0}\\3dtile.exe -f osgb -i \"{1}\" -o \"{2}\" -c \"{{\\\"offset\\\": {3}}}\"", d3tilesPath, osgbPath, outPath, args.z); + int idx = args.ids.IndexOf(meta.id); + string cmd = string.Format("{0}\\3dtile.exe -f osgb -i \"{1}\" -o \"{2}\" -c \"{{\\\"offset\\\": {3}}}\"", d3tilesPath, osgbPath, outPath, args.zs[idx]); err = Tools.ExecCmd(cmd, false, false); err = null; diff --git a/ExportMap/export.html b/ExportMap/export.html index cd4fd56..59a8e02 100644 --- a/ExportMap/export.html +++ b/ExportMap/export.html @@ -136,7 +136,7 @@ // 娴嬭瘯OSGB function toOsgb() { - var data = { token: token, ids: [10290], depcode: "00", dircode: "0C", userId: 1, name: "3-1鍊炬枩妯″瀷-涓崼绔�" }; + var data = { token: token, ids: [10290], 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); @@ -145,7 +145,7 @@ // 娴嬭瘯Las function toLas() { - var data = { token: token, ids: [7188], depcode: "00", dircode: "0C", userId: 1, name: "HL_point_cloud_part_1.las", srid: 4548, z: 0 }; + 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/ToLas", "POST", JSON.stringify(data), null, null, function (rs) { alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result); console.log(rs); @@ -154,7 +154,7 @@ // 娴嬭瘯Laz function toLaz(){ - var data = { token: token, ids: [10285], depcode: "00", dircode: "0C", userId: 1, name: "577.laz", srid: 4548, z: 0 }; + 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); -- Gitblit v1.9.3