Osm sample stylesheet

Topics: WinForms Controls
Aug 27, 2015 at 2: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 (www.openstreetmap.org)? 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 7: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 8: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 1:31 PM
Edited Sep 3, 2015 at 2: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 9:47 AM
One last question - does the Styled Layer Descriptor Converter need the Internet, or can it work offline?

Sep 4, 2015 at 11:10 AM
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)