Beispiel #1
0
        static void PMapTest()
        {
            var b = new Boundary {
                Minx = -180, Maxx = 180, Miny = -90, Maxy = 90
            };
            const int dx = 20;
            const int dy = 20;

            var xy = GridCluster.GetPointMappedIds(new P {
                X = 175, Y = 35
            }, b, dx, dy);

            CWF("x: {0}   y: {1}", xy[0], xy[1]);

            xy = GridCluster.GetPointMappedIds(new P {
                X = 175, Y = 35
            }, b, dx, dy);
            CWF("x: {0}   y: {1}", xy[0], xy[1]);

            xy = GridCluster.GetPointMappedIds(new P {
                X = 180, Y = 35
            }, b, dx, dy);
            CWF("x: {0}   y: {1}", xy[0], xy[1]);

            xy = GridCluster.GetPointMappedIds((new P {
                X = 181, Y = 35
            }).Normalize(), b, dx, dy);
            CWF("x: {0}   y: {1}", xy[0], xy[1]);

            xy = GridCluster.GetPointMappedIds((new P {
                X = -181, Y = 35
            }).Normalize(), b, dx, dy);
            CWF("x: {0}   y: {1}", xy[0], xy[1]);
        }