ExportMap/Controllers/ConvertController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ExportMap/ExportMap.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ExportMap/Models/SysMeta.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ExportMap/Models/XYZArgs.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ExportMap/cs/CacheUtils.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ExportMap/cs/ConvertUtils.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ExportMap/cs/SGUtils.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ExportMap/cs/Tool.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ExportMap/cs/XYZUtil.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ExportMap/cs/XYZUtils.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ExportMap/export.html | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
ExportMap/Controllers/ConvertController.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,37 @@ using ExportMap.cs; using ExportMap.Models; using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Web.Http; namespace ExportMap.Controllers { public class ConvertController : ApiController { [HttpPost] public ResponseMsg<int> ToTileset([FromBody]ExportArgs args) { try { return ResponseMsg<int>.success("æå", 1); } catch (Exception ex) { LogOut.Error(ex.StackTrace); return ResponseMsg<int>.fail(ex.Message); } } [HttpGet] public ResponseMsg<string> Test() { return ResponseMsg<string>.success("æå", ""); } } } ExportMap/ExportMap.csproj
@@ -129,17 +129,19 @@ </ItemGroup> <ItemGroup> <Compile Include="App_Start\WebApiConfig.cs" /> <Compile Include="Controllers\ConvertController.cs" /> <Compile Include="Controllers\ExportController.cs" /> <Compile Include="Controllers\FloatServerController.cs" /> <Compile Include="Controllers\licenseEncryptionController.cs" /> <Compile Include="cs\CacheUtil.cs" /> <Compile Include="cs\CacheUtils.cs" /> <Compile Include="cs\ConvertUtils.cs" /> <Compile Include="cs\CustomMultipartFormDataStreamProvider.cs" /> <Compile Include="cs\ExportUtil.cs" /> <Compile Include="cs\LogOut.cs" /> <Compile Include="cs\NoBufferPolicySelector.cs" /> <Compile Include="cs\SGUtil.cs" /> <Compile Include="cs\SGUtils.cs" /> <Compile Include="cs\Tool.cs" /> <Compile Include="cs\XYZUtil.cs" /> <Compile Include="cs\XYZUtils.cs" /> <Compile Include="db\ModelHandler.cs" /> <Compile Include="db\PostgreHelper.cs" /> <Compile Include="db\SQLiteHelper.cs" /> @@ -150,6 +152,7 @@ <Compile Include="Models\ExportArgs.cs" /> <Compile Include="Models\ResponseMsg.cs" /> <Compile Include="Models\Secret.cs" /> <Compile Include="Models\SysMeta.cs" /> <Compile Include="Models\XYZArgs.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> ExportMap/Models/SysMeta.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,50 @@ using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace ExportMap.Models { public class SysMeta { public int id { set; get; } public string eventid { set; get; } public int metaid { set; get; } public int ismeta { set; get; } public string depcode { set; get; } public string dircode { set; get; } public int verid { set; get; } public string name { set; get; } public string type { set; get; } public string guid { set; get; } public string path { set; get; } public double sizes { set; get; } public string tab { set; get; } public string layer { set; get; } public int rows { set; get; } public int create_user { set; get; } public DateTime create_time { set; get; } public int update_user { set; get; } public DateTime update_time { set; get; } public string bak { set; get; } } } ExportMap/Models/XYZArgs.cs
@@ -31,9 +31,9 @@ public int max { set; get; } /// <summary> /// æ°æ®ç®å½ID /// æ°æ®ç®å½ç¼ç /// </summary> public string dirid { set; get; } public string dircode { set; get; } /// <summary> /// å æ°æ®IDéå ExportMap/cs/CacheUtils.cs
ÎļþÃû´Ó ExportMap/cs/CacheUtil.cs ÐÞ¸Ä @@ -11,11 +11,11 @@ /// <summary> /// ç¼åå¸¸ç¨æä½ /// </summary> public class CacheUtil public class CacheUtils { public static CacheItemRemovedReason reason; public CacheUtil() public CacheUtils() { } ExportMap/cs/ConvertUtils.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,12 @@ using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace ExportMap.cs { public class ConvertUtils { } } ExportMap/cs/SGUtils.cs
ÎļþÃû´Ó ExportMap/cs/SGUtil.cs ÐÞ¸Ä @@ -6,7 +6,7 @@ namespace ExportMap.cs { public class SGUtil public class SGUtils { /// <summary> /// Mptç®å½ ExportMap/cs/Tool.cs
@@ -1,4 +1,5 @@ using Npgsql; using ExportMap.db; using Npgsql; using System; using System.Collections.Generic; using System.Configuration; @@ -21,6 +22,24 @@ /// åºç¡ç®å½ /// </summary> public static readonly string BaseDir = AppDomain.CurrentDomain.BaseDirectory; private static PostgreHelper _dbHelper; /// <summary> /// DB帮å©ç±» /// </summary> public static PostgreHelper DBHelper { get { if (null == _dbHelper) { _dbHelper = new PostgreHelper(DbEnum.langfang); } return _dbHelper; } } /// <summary> /// åèæ ¼å¼å @@ -166,7 +185,6 @@ } return str; } } } ExportMap/cs/XYZUtil.cs
ÎļþÒÑɾ³ý ExportMap/cs/XYZUtils.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,89 @@ using ExportMap.db; using ExportMap.Models; using System; using System.Collections.Generic; using System.Data; using System.IO; using System.Linq; using System.Web; namespace ExportMap.cs { public class XYZUtils { private static string pyFile; /// <summary> /// è·åPythonæä»¶ /// </summary> public static string PyFile { get { if (string.IsNullOrWhiteSpace(pyFile)) { pyFile = Path.Combine(ExportUtil.SourcesPath, "xyz.py"); } return pyFile; } } /// <summary> /// QGISå·¥ç¨ /// </summary> public static string Qgz { get { return "xyz.qgz"; } } /// <summary> /// çæ /// </summary> /// <param name="args">XYZåæ°</param> /// <param name="err">é误信æ¯</param> /// <returns>æ°æ®åå¸ID</returns> public static int Generate(XYZArgs args, ref string err) { string tifFile = Path.Combine(ExportUtil.SourcesPath, ExportUtil.DateStr + ".txt"); string xyzPath = Path.Combine(SGUtils.LFData, "2d\\tiles", args.id.ToString()); if (!Directory.Exists(xyzPath)) Directory.CreateDirectory(xyzPath); string cmd = string.Format("python {0} -qgz {1} -file {2} -out {3} -min {4} -max {5}", PyFile, Qgz, tifFile, xyzPath, args.min, args.max); err = Tool.ExecPython(cmd); return args.id; } /// <summary> /// æ¥è¯¢å æ°æ® /// </summary> private static List<SysMeta> selectMetas(string dircode) { string sql = string.Format("select * from lf.sys_meta where dircode like '{0}%'", dircode); DataTable dt = Tool.DBHelper.GetDataTable(sql); List<SysMeta> list = ModelHandler.FillModel<SysMeta>(dt); return list; } /// <summary> /// æ¥è¯¢å æ°æ® /// </summary> private static List<SysMeta> selectMetas(List<int> ids) { string sql = string.Format("select * from lf.sys_meta where id in ({0})", string.Join(",", ids)); DataTable dt = Tool.DBHelper.GetDataTable(sql); List<SysMeta> list = ModelHandler.FillModel<SysMeta>(dt); return list; } } } ExportMap/export.html
@@ -84,5 +84,8 @@ </select> <input type="button" value="åºå¾-1" onclick="exportMap1()" /> <input type="button" value="åºå¾-2" onclick="exportMap2()" /> <br /><br /> <a href="Convert/Test" >æµè¯rvt</a> </body> </html>