コード例 #1
0
ファイル: Program.cs プロジェクト: ptv-logistics/xserver.net
        static void Main(string[] args)
        {
            SimpleTest();

            Console.SetWindowSize(120, 60);

            Thread.CurrentThread.CurrentCulture   = CultureInfo.InvariantCulture;
            Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture;

            string r1 = Registry.GetContent();
            string r2 = Registry.GetContent(true);

            Direct.CoordinateTransformation.Enabled = true;

            double x = 8, y = 49;

            CoordinateTransformation.Get("EPSG:4326", "PTV_MERCATOR").Transform(x, y, out x, out y);

            string wkt = Registry.Get("cfGeoMinSek").WKT;

            MessageBox.Show(wkt);

            CoordinateReferenceSystem.Parse("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +custom=Ptv.Components.Projections.Custom.GeoMinSekTransformation");

            Registry.SetContent(r1, true, true);

            ICoordinateTransformation t = Proj4.CoordinateTransformation.Get("cfGEOMINSEK", "EPSG:76131");

            System.Windows.Point p =
                new System.Windows.Point(959361, 5332563);

            t.Transform(p);

            SimpleTest();
            ExtendedTest();
        }