This project has moved and is read-only. For the latest updates, please go here.

Osm sample stylesheet

Topics: WinForms Controls
Aug 27, 2015 at 3:47 PM

I am using SharpMap in a WPF application in C# to display OSM data. I can display the data from either a PostGIS server or from shapefiles, using the MapBox control.

Is there a stylesheet available for SharpMap that will allow me to style the map so that it looks similar to the map on the OSM website ( Or do I have to write every single style for every single layer separately (which would lead to having to write several thousand lines of code)?

Thanks for your help.
Aug 28, 2015 at 8:00 AM
Not that I know of, but
Perhaps these can get you going without having to write several thousand lines of code.
Sep 3, 2015 at 9:32 AM
Thank you for your help.

Is the Styled Layer Descriptor Converter available with SharpMap Version 1.1? Or do I have to use Version 1.0?

Sep 3, 2015 at 2:31 PM
Edited Sep 3, 2015 at 3:08 PM
It will be part of SharpMap 1.2. For the time being you can grab the code as is.
As an alternative you may be able to tweak some C# CSS Parser to parse mapnik css files into IStyles.
Sep 4, 2015 at 10:47 AM
One last question - does the Styled Layer Descriptor Converter need the Internet, or can it work offline?

Sep 4, 2015 at 12:10 PM
as you can see by looking at the source, it takes either
  • a string containing the sld xml (ParseFeatureStyleFromXmlText),
  • a string containing the path to a sld xml file (ParseFeatureStyleFromFile) or
  • a XmlDocument (ParseFeatureStyle)