private void AddListPointSymbolizerLayers(Map map, PointAlignment mode)
        {
            var pts = GetSymbolizerPoints(mode);

            var vLyr = new VectorLayer("ListPoint with Pps and Cps", new GeometryFeatureProvider(pts.AsEnumerable()));
            var pps  =
                SharpMap.Rendering.Symbolizer.PathPointSymbolizer.CreateSquare(new System.Drawing.Pen(System.Drawing.Color.Red, 2),
                                                                               new System.Drawing.SolidBrush(
                                                                                   System.Drawing.Color.DodgerBlue), 20);

            var cps = new SharpMap.Rendering.Symbolizer.CharacterPointSymbolizer
            {
                Halo           = 1,
                HaloBrush      = new System.Drawing.SolidBrush(System.Drawing.Color.WhiteSmoke),
                Foreground     = new System.Drawing.SolidBrush(System.Drawing.Color.Black),
                Font           = new System.Drawing.Font("Arial", 12),
                CharacterIndex = 65
            };

            var lps = new SharpMap.Rendering.Symbolizer.ListPointSymbolizer {
                pps, cps
            };

            vLyr.Style.PointSymbolizer = lps;
            map.Layers.Add(vLyr);

            vLyr = new VectorLayer("ReferencePoint", new GeometryFeatureProvider(pts.AsEnumerable()));
            vLyr.Style.PointSize  = 4f;
            vLyr.Style.PointColor = Brushes.Yellow;
            map.Layers.Add(vLyr);
        }
Esempio n. 2
0
        public void TestListPointSymbolizer()
        {
            var fdt = TestData.CreatingData.CreatePointFeatureDataTableFromArrays(
                TestData.CreatingData.GetRandomOrdinates(50, -180, 180), TestData.CreatingData.GetRandomOrdinates(50, -90, 90), null);
            var geometryFeatureProvider = new SharpMap.Data.Providers.FeatureProvider(fdt);
            var layer = new SharpMap.Layers.VectorLayer("randompoints", geometryFeatureProvider);
            var pps   =
                SharpMap.Rendering.Symbolizer.PathPointSymbolizer.CreateSquare(new System.Drawing.Pen(System.Drawing.Color.Red, 2),
                                                                               new System.Drawing.SolidBrush(
                                                                                   System.Drawing.Color.DodgerBlue), 20);

            var cps = new SharpMap.Rendering.Symbolizer.CharacterPointSymbolizer
            {
                Halo           = 1,
                HaloBrush      = new System.Drawing.SolidBrush(System.Drawing.Color.WhiteSmoke),
                Foreground     = new System.Drawing.SolidBrush(System.Drawing.Color.Black),
                Font           = new System.Drawing.Font("Arial", 12),
                CharacterIndex = 65
            };

            var lps = new SharpMap.Rendering.Symbolizer.ListPointSymbolizer {
                pps, cps
            };

            layer.Style.PointSymbolizer = lps;
            var map = new SharpMap.Map(new System.Drawing.Size(720, 360));

            map.Layers.Add(layer);
            map.ZoomToExtents();
            map.GetMap().Save("ListPointSymbolizer1.bmp");
        }
        public void TestListPointSymbolizer()
        {
            var fdt = TestData.CreatingData.CreatePointFeatureDataTableFromArrays(
                TestData.CreatingData.GetRandomOrdinates(50, -180, 180), TestData.CreatingData.GetRandomOrdinates(50, -90, 90), null);
            var geometryFeatureProvider = new SharpMap.Data.Providers.GeometryFeatureProvider(fdt);
            var layer = new SharpMap.Layers.VectorLayer("randompoints", geometryFeatureProvider);
            var pps =
                SharpMap.Rendering.Symbolizer.PathPointSymbolizer.CreateSquare(new System.Drawing.Pen(System.Drawing.Color.Red, 2),
                                                                    new System.Drawing.SolidBrush(
                                                                        System.Drawing.Color.DodgerBlue), 20);

            var cps = new SharpMap.Rendering.Symbolizer.CharacterPointSymbolizer
            {
                Halo = 1,
                HaloBrush = new System.Drawing.SolidBrush(System.Drawing.Color.WhiteSmoke),
                Foreground = new System.Drawing.SolidBrush(System.Drawing.Color.Black),
                Font = new System.Drawing.Font("Arial", 12),
                CharacterIndex = 65
            };

            var lps = new SharpMap.Rendering.Symbolizer.ListPointSymbolizer { pps, cps };

            layer.Style.PointSymbolizer = lps;
            var map = new SharpMap.Map(new System.Drawing.Size(720, 360));
            map.Layers.Add(layer);
            map.ZoomToExtents();
            map.GetMap().Save("ListPointSymbolizer1.bmp");
        }
        public void TestRasterPointSymbolizer()
        {
            var fdt = TestData.CreatingData.CreatePointFeatureDataTableFromArrays(
                TestData.CreatingData.GetRandomOrdinates(50, -180, 180), TestData.CreatingData.GetRandomOrdinates(50, -90, 90), null);
            var geometryFeatureProvider = new SharpMap.Data.Providers.GeometryFeatureProvider(fdt);
            var layer = new SharpMap.Layers.VectorLayer("randompoints", geometryFeatureProvider);


            var wmnStream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("UnitTests.Resources.Women.png");
            var wmnBmp    = new System.Drawing.Bitmap(wmnStream);

            var rps =
                new SharpMap.Rendering.Symbolizer.RasterPointSymbolizer {
                Symbol = wmnBmp
            };

            layer.Style.PointSymbolizer = rps;
            var map = new SharpMap.Map(new System.Drawing.Size(720, 360));

            map.Layers.Add(layer);
            map.ZoomToExtents();
            map.GetMap().Save(System.IO.Path.Combine(UnitTestsFixture.GetImageDirectory(this), "RasterPointSymbolizer1.bmp"));

            rps.Rotation = 45;
            map.GetMap().Save(System.IO.Path.Combine(UnitTestsFixture.GetImageDirectory(this), "RasterPointSymbolizer2.bmp"));
            rps.Rotation = 0;

            var cps = new SharpMap.Rendering.Symbolizer.CharacterPointSymbolizer
            {
                Halo       = 1,
                HaloBrush  = new System.Drawing.SolidBrush(System.Drawing.Color.WhiteSmoke),
                Foreground = new System.Drawing.SolidBrush(System.Drawing.Color.Black),
                Font       = new System.Drawing.Font("Arial", 12),
                Text       = "Anne",
                Offset     = new System.Drawing.PointF(0, rps.Size.Height * 0.5f)
            };

            var lps = new SharpMap.Rendering.Symbolizer.ListPointSymbolizer {
                rps, cps
            };

            layer.Style.PointSymbolizer = lps;
            map.Layers.Add(layer);
            map.ZoomToExtents();
            map.GetMap().Save(System.IO.Path.Combine(UnitTestsFixture.GetImageDirectory(this), "RasterPointSymbolizer3.bmp"));
        }
Esempio n. 5
0
        public void TestRasterPointSymbolizer()
        {
            var fdt = TestData.CreatingData.CreatePointFeatureDataTableFromArrays(
                TestData.CreatingData.GetRandomOrdinates(50, -180, 180), TestData.CreatingData.GetRandomOrdinates(50, -90, 90), null);
            var geometryFeatureProvider = new SharpMap.Data.Providers.FeatureProvider(fdt);
            var layer = new SharpMap.Layers.VectorLayer("randompoints", geometryFeatureProvider);
            var rps   =
                new SharpMap.Rendering.Symbolizer.RasterPointSymbolizer {
                Symbol = Properties.Resources.Women
            };

            layer.Style.PointSymbolizer = rps;
            var map = new SharpMap.Map(new System.Drawing.Size(720, 360));

            map.Layers.Add(layer);
            map.ZoomToExtents();
            map.GetMap().Save("RasterPointSymbolizer1.bmp");

            rps.Rotation = 45;
            map.GetMap().Save("RasterPointSymbolizer2.bmp");
            rps.Rotation = 0;

            var cps = new SharpMap.Rendering.Symbolizer.CharacterPointSymbolizer
            {
                Halo       = 1,
                HaloBrush  = new System.Drawing.SolidBrush(System.Drawing.Color.WhiteSmoke),
                Foreground = new System.Drawing.SolidBrush(System.Drawing.Color.Black),
                Font       = new System.Drawing.Font("Arial", 12),
                Text       = "Anne",
                Offset     = new System.Drawing.PointF(0, rps.Size.Height * 0.5f)
            };

            var lps = new SharpMap.Rendering.Symbolizer.ListPointSymbolizer {
                rps, cps
            };

            layer.Style.PointSymbolizer = lps;
            map.Layers.Add(layer);
            map.ZoomToExtents();
            map.GetMap().Save("RasterPointSymbolizer3.bmp");
        }
        public void TestRasterPointSymbolizer()
        {
            var fdt = TestData.CreatingData.CreatePointFeatureDataTableFromArrays(
                TestData.CreatingData.GetRandomOrdinates(50, -180, 180), TestData.CreatingData.GetRandomOrdinates(50, -90, 90), null);
            var geometryFeatureProvider = new SharpMap.Data.Providers.GeometryFeatureProvider(fdt);
            var layer = new SharpMap.Layers.VectorLayer("randompoints", geometryFeatureProvider);
            var rps =
                new SharpMap.Rendering.Symbolizer.RasterPointSymbolizer {Symbol = Properties.Resources.Women};

            layer.Style.PointSymbolizer = rps;
            var map = new SharpMap.Map(new System.Drawing.Size(720, 360));
            map.Layers.Add(layer);
            map.ZoomToExtents();
            map.GetMap().Save("RasterPointSymbolizer1.bmp");

            rps.Rotation = 45;
            map.GetMap().Save("RasterPointSymbolizer2.bmp");
            rps.Rotation = 0;

            var cps = new SharpMap.Rendering.Symbolizer.CharacterPointSymbolizer
                          {
                              Halo = 1,
                              HaloBrush = new System.Drawing.SolidBrush(System.Drawing.Color.WhiteSmoke),
                              Foreground = new System.Drawing.SolidBrush(System.Drawing.Color.Black),
                              Font = new System.Drawing.Font("Arial", 12),
                              Text = "Anne",
                              Offset = new System.Drawing.PointF(0, rps.Size.Height*0.5f)

            };

            var lps = new SharpMap.Rendering.Symbolizer.ListPointSymbolizer { rps, cps };

            layer.Style.PointSymbolizer = lps;
            map.Layers.Add(layer);
            map.ZoomToExtents();
            map.GetMap().Save("RasterPointSymbolizer3.bmp");
        }