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

SharpMap and *.osm

Topics: Data Access, SharpMap v0.9 / v1.x
Aug 18, 2011 at 1:34 PM
Edited Aug 18, 2011 at 2:05 PM

Hello everybody. I'm looking for the ansewer: "Can I use SharpMap with datasource from *.osm file(file was downloaded from . I have to use it offline/standalone PC) and HOW?"

I've tried to use code like this but nothing happens:

        const string filePath = @"D:\Temp\���������\gis_OSM\Map\";

        SharpMap.Map _globalMap;

        /// <summary>
        /// Constructor osmMAP
        /// </summary>
        public osmMAP(System.Drawing.Size _mapSize)
            _globalMap = new SharpMap.Map(_mapSize);
            var fSource = new TileSource(new FileTileProvider(new FileCache(filePath, "osm")), new TileSchema() );
            var osmFileLayer = new TileLayer(fSource, "OSM FileLayer");

        public System.Drawing.Image getImage()
            return _globalMap.GetMap();

I've tried to use TileSchema like in source examples. It doesn't help/

I see just SharpMap.Forms.MapImage.BackColor color ((

Aug 18, 2011 at 9:05 PM


You are using the TileLayer but none of downloads I see at cloudmade are in a tileformat. You could try the shapefile instead.


Aug 18, 2011 at 9:16 PM

The main idea is to use *.osm files from cloudmade. I don't understand what should I do(if it's possible)... 

I haven't found any example or documentation((

Aug 19, 2011 at 5:39 AM

There is currently no driver for SharpMap that can read the *.OSM format. At the moment you need to use the shapefile format also available at CloudMade

Aug 19, 2011 at 5:57 AM

thank you for advice

Aug 21, 2011 at 10:07 AM

Another option would be to set up your own OSM-tileserver with mapnik rendering and PostgreSQL db and make a tilecache render. Then you can use Brutile to render the tiles in the map location. It will cost you a lot of disk space compared to just downloading the shapefiles and rendering them on the fly, but it gives you the advantage of the beautiful map rendering of Mapnik and offline some speedups as well.

I've done it and it's not difficult, but you need to know a little bit of Linux and Python