From 124486dbffb46b6a80008b0ba591c254643de0ad Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期三, 20 九月 2023 10:51:13 +0800
Subject: [PATCH] 1

---
 DataLoader/MainWindow.xaml.cs |    1 +
 DataLoader/CS/GdalHelper.cs   |   22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/DataLoader/CS/GdalHelper.cs b/DataLoader/CS/GdalHelper.cs
index 95153a8..ec69d5d 100644
--- a/DataLoader/CS/GdalHelper.cs
+++ b/DataLoader/CS/GdalHelper.cs
@@ -261,5 +261,27 @@
             meta.max = string.Join(",", maxList.ToArray());
         }
         #endregion
+
+        public void CsTransform(double x, double y, int epsg)
+        {
+            SpatialReference srs = new SpatialReference(null);
+            srs.ImportFromEPSG(epsg);
+
+            Geometry point = new Geometry(wkbGeometryType.wkbPoint);
+            point.AddPoint(x, y, 0);
+            point.AssignSpatialReference(srs);
+
+            if (srs.GetName().Contains("CGCS2000"))
+            {
+                point.TransformTo(sr4490);
+            }
+            else
+            {
+                point.TransformTo(sr4326);
+            }
+            point.SwapXY();
+
+            double[] xy = new double[] { point.GetX(0), point.GetY(0) };
+        }
     }
 }
diff --git a/DataLoader/MainWindow.xaml.cs b/DataLoader/MainWindow.xaml.cs
index 2cf997b..3b7ddd5 100644
--- a/DataLoader/MainWindow.xaml.cs
+++ b/DataLoader/MainWindow.xaml.cs
@@ -36,6 +36,7 @@
             CommonProp.Init();
 
             this.btnLoad.IsEnabled = false;
+            this.btnDel.IsEnabled = false;
             this.btnImport.IsEnabled = false;
 
             lvView.DataContext = viewDatas;

--
Gitblit v1.9.3