| | |
| | | using ExportMap.Models; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.IO; |
| | | using System.Linq; |
| | | using System.Net; |
| | | using System.Net.Http; |
| | |
| | | [HttpGet] |
| | | public string Test() |
| | | { |
| | | //string name = "8-瑞丽站0.05m.cpt"; |
| | | //string cnName = name.Substring(0, name.LastIndexOf(".")); |
| | | //string cnName = "8-瑞丽站0.05m.cpt".Substring(0, "8-瑞丽站0.05m.cpt".LastIndexOf(".")); |
| | | //return Tools.GetLocalIP(); |
| | | //return Tools.GetEPSG("D:\\Moon\\data\\dem_tif\\ldem.tif"); |
| | | //TerrainUtils.Reproject("D:/xyz/dem/dem/32a.tif", "D:/xyz/dem/dem/32a_4326_.tif", "EPSG:4528", "EPSG:4326"); |
| | | //TerrainUtils.Project("D:/xyz/dem/dem/32a_4326_.tif", "EPSG:4490"); |
| | | //string wkt = TerrainUtils.GetPointZ(new XYZArgs() { dircode = "0B" }); |
| | | //PyLasUtils.CsTransform("EPSG:4528", 400925.079, 2541768.173); |
| | | //string json = PyLasUtils.GetLasGeomJSON(@"D:\LF\data\las\1_lfz_0.05m.las", 1314); |
| | | TerrainUtils.Complement(new XYZArgs() { dircode = "00" }); |
| | | |
| | | return Tools.GetLocalIP(); |
| | | return DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | checkMinMax(args); |
| | | |
| | | string err = null; |
| | | List<int> rs = TerraUtils.Generate(args, ref err); |
| | | //List<int> rs = TerraUtils.Generate(args, ref err); |
| | | List<int> rs = TerrainUtils.Generate(args, ref err); |
| | | if (null == rs || rs.Count == 0) |
| | | { |
| | | return ResponseMsg<string>.fail(null == err ? "失败" : err); |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Py转换LAS |
| | | /// </summary> |
| | | [HttpPost] |
| | | public ResponseMsg<string> ToLasByPy([FromBody]XYZArgs args) |
| | | { |
| | | try |
| | | { |
| | | ResponseMsg<string> msg = checkArgs(args); |
| | | if (null != msg) return msg; |
| | | |
| | | //if (args.srids.Count != args.ids.Count) return ResponseMsg<string>.fail("坐标系ID集合与元数据ID集合长度不一致"); |
| | | //if (args.zs.Count != args.ids.Count) return ResponseMsg<string>.fail("高度偏移量集合与元数据ID集合长度不一致"); |
| | | |
| | | string err = null; |
| | | List<int> rs = PyLasUtils.Generate(args, ref err); |
| | | if (null == rs || rs.Count == 0) |
| | | { |
| | | return ResponseMsg<string>.fail(null == err ? "失败" : err); |
| | | } |
| | | |
| | | return ResponseMsg<string>.success("成功", string.Join(",", rs), rs.Count); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | LogOut.Error(ex.Message + "\r\n" + ex.StackTrace); |
| | | return ResponseMsg<string>.fail(ex.Message); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 删除文件 |
| | | /// </summary> |
| | | [HttpPost] |
| | |
| | | |
| | | } |
| | | |
| | | [HttpGet] |
| | | public string GetRasterEPSG(int id) |
| | | { |
| | | SysMeta meta = XYZUtils.SelectMeta(id); |
| | | if (null == meta || string.IsNullOrEmpty(meta.path)) return null; |
| | | |
| | | string file = Path.Combine(Tools.GetSetting("uploadFolder"), meta.path); |
| | | if (!File.Exists(file)) return null; |
| | | |
| | | return Tools.GetEPSG(file); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 检查参数 |
| | | /// </summary> |