[Tile-serving] [openstreetmap/osm2pgsql] Blank screen as output in Sharpmap with Postgis as the databse (#625)

Shree1100 notifications at github.com
Fri Sep 30 09:41:08 UTC 2016


Following is the code attached which when executed gives a blank output screen. I am using Postgresql Database with my dbname=osm1.


SharpMap.Layers.VectorLayer myLayer = new SharpMap.Layers.VectorLayer("My layer");
string ConnStr = "Server=127.0.0.1;Port=5432;User Id=postgres;Password=osm;Database=osm1;";
string idColumn = "building";
myLayer.DataSource = new SharpMap.Data.Providers.PostGIS(ConnStr, "planet_osm_polygon", idColumn);

ProjNet.CoordinateSystems.Transformations.CoordinateTransformationFactory ctFact = new ProjNet.CoordinateSystems.Transformations.CoordinateTransformationFactory();
myLayer.CoordinateTransformation = ctFact.CreateFromCoordinateSystems(ProjNet.CoordinateSystems.GeographicCoordinateSystem.WGS84, ProjNet.CoordinateSystems.ProjectedCoordinateSystem.WebMercator);
myLayer.ReverseCoordinateTransformation = ctFact.CreateFromCoordinateSystems(ProjNet.CoordinateSystems.ProjectedCoordinateSystem.WebMercator, ProjNet.CoordinateSystems.GeographicCoordinateSystem.WGS84);

mapBox1.Map.Layers.Add(myLayer);
mapBox1.Map.BackgroundLayer.Add(new SharpMap.Layers.TileAsyncLayer(new BruTile.Web.OsmTileSource(), "OSM"));
mapBox1.Map.ZoomToExtents();
mapBox1.Refresh();
mapBox1.ActiveTool = SharpMap.Forms.MapBox.Tools.Pan;
            
Kindly help as i am stuck as the db in pgAdmin4 contains all the tables.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/issues/625
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20160930/ea96af67/attachment.html>


More information about the Tile-serving mailing list