This project has moved. For the latest updates, please go here.
1
Vote

polygon layer not showing from sql server

description

I am adding a sql server polygon layer to a map, but it is not showing.
Adding it as a shapefile is not a problem.
Anybody know why this could be a problem? A point layer from sql server is not a problem.
        SharpMap.Layers.VectorLayer gemeenteLaag = new SharpMap.Layers.VectorLayer("gemeente");
        SharpMap.Layers.VectorLayer provincieLaag = new SharpMap.Layers.VectorLayer("provincie");

        string connstr = "server=193.190.112.132; initial catalog = EMAV; persist security info = True; user id = EMAV_user; password = LaatMijBinnen0";

        gemeenteLaag.DataSource = new SharpMap.Data.Providers.SqlServer2008(connstr, "refgem", "ogr_geometry", "ogr_fid",SharpMap.Data.Providers.SqlServerSpatialObjectType.Geometry,false,31370);
        //gemeenteLaag.DataSource = new SharpMap.Data.Providers.ShapeFile(@"F:\project\GIS\gemeente\refgem.shp", true);
        provincieLaag.DataSource = new SharpMap.Data.Providers.ShapeFile(@"F:\project\GIS\gemeente\refprv.shp", true);
        gemeenteLaag.SRID = 31370;
        provincieLaag.SRID = 31370;


        provincieLaag.Style.Outline = Pens.Black;           
        provincieLaag.Style.Fill = Brushes.Transparent;
        provincieLaag.Style.EnableOutline = true;
        gemeenteLaag.Style.Outline = Pens.Blue;
        gemeenteLaag.Style.Fill = Brushes.Transparent;
        gemeenteLaag.Style.EnableOutline = true;


        mapBox1.Map.Layers.Add(gemeenteLaag);
        mapBox1.Map.Layers.Add(provincieLaag);
        mapBox1.Map.ZoomToExtents();

        SharpMap.Layers.VectorLayer expLaag = new SharpMap.Layers.VectorLayer("exp");
        expLaag.DataSource = new SharpMap.Data.Providers.SqlServer2008(connstr, "geoExploitatie", "Geom", "ID", SharpMap.Data.Providers.SqlServerSpatialObjectType.Geometry);
        expLaag.SRID = 31370;
        mapBox1.Map.Layers.Add(expLaag);



        mapBox1.Refresh();
        mapBox1.ActiveTool = SharpMap.Forms.MapBox.Tools.Pan;

comments