示例#1
0
        public MainWindow()
        {
            InitializeComponent();
            m_GeoSpace = new GeoStar.Core.Control.WPF.GeoSpaceView2D();
            MapContainer.Children.Add(m_GeoSpace);
            m_GeoSpace.MouseMove += M_GeoSpace_MouseMove;
            GeoStar.Core.GlobeConifg.Singleton.Child("GeoSpaceView2D\\ShowTileBound").Value = "false";

            LoadTMS("Tianditu", "http://t${Odd-Even7}.tianditu.com/DataServer?T=vec_c&x=${Col}&y=${Row}&l=${Level}");
            string path = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "quadtree.csv");

            m_Watch = new WatchQuadTree(path);
            m_GeoSpace.LayerBox.AddLayer(m_Watch);
            m_Watch.OnUpdate += M_Watch_OnUpdate;
            m_GeoSpace.ViewFullMap();
        }
示例#2
0
        public MainWindow()
        {
            InitializeComponent();



            GeoStar.Core.Kernel.Initialize();
            double[] arr = new double[] {
                108.562396006656, 25.3444259567388,
                115.71846921797, 28.1557404326123,
                114.35540765391, 31.2226289517471,
                108.647587354409, 32.6708818635607,
                108.051247920133, 30.2855241264559
            };

            GeoStar.Core.GeodesicPolygon p = new GeoStar.Core.GeodesicPolygon(new GeoStar.Core.SpatialReference(GeoStar.Core.WellKnownSpatialReference.eWGS84));

            GeoStar.Core.Ring r = new GeoStar.Core.Ring(arr, 2);
            double            a = r.GeodesicArea(p);

            p = new GeoStar.Core.GeodesicPolygon(new GeoStar.Core.SpatialReference(GeoStar.Core.WellKnownSpatialReference.eWGS84));
            for (int i = 0; i < arr.Length; i += 2)
            {
                p.AddPoint(arr[i], arr[i + 1]);
            }
            double area = 0;
            uint   n    = p.Compute(false, true, ref area);

            m_GeoSpace = new GeoStar.Core.Control.WPF.GeoSpaceView2D();
            MapContainer.Children.Add(m_GeoSpace);
            LoadMap(@"d:\400w\400wfull.GMAPX");
            // //LoadMap(@"D:\400w\配图和数据\徐州配图_fcs_4326\xz.GMAPX");

            // //LoadMap();
            // //LoadFCS(@"D:\400w\gadmfcs",true,false);
            // //LoadFCS(@"D:\400w\400fcs",false,false);

            // //LoadTMS("OSM", "http://${ThirdChar}.tile.openstreetmap.org/${Level}/${Col}/${Row}.png");
            //// m_GeoSpace.ViewFullMap();
            m_GeoSpace.MouseMove += M_GeoSpace_MouseMove;
        }