I would like to create a map from C# VS2013 WPF desktop application (not web application) with OpenStreetMap on win7.
This a colored map with US states colorized differently.
This can be shown in the attachment below.
I am new to WPF and handle the map tiles from XAML.
It seems to be very hard to find state or zip code borders from the map tiles and do coloring on them. I know that adding a colored map tile layer on the map may be working. But I would like to see some code examples to follow so that I can implement my design based on it.
Are there some open source C# code that have done the similar things ?
Boundaries could be specified directly as a closed way, as a relation with ways as members, as here, or as a relation with ways and relations as members, as for the USA as a whole: http://www.openstreetmap.org/relation/148838
There are probably tools that will resolve the relations into a set of polygons (e.g. the USA has disjoint polygons, for Hawaii, Alaska, etc.). The rendering tools may well be able to render a map with these features coloured directly from the map, although they may need help in selecting the colours.
I’m not sure that there will be tools to automatically select colours.
There are services for creating “shapefiles” from OSM data: http://wiki.openstreetmap.org/wiki/Shapefiles However, in your case, you might want to run you own OSM renderer. I assume, but don’t know for certain, that that is capable of shading complex relations like US states. I assume you will need to pre-assign colours using some other algorithm.
Incidentally, starting with a requirement to use the Microsoft .NET ecosystem, may prove seriously constraining, as the cheapest solution is likely to involve modifying open source tools that have not been written in .NET languages.