I'm curious if there are any style guidelines for the OSM shapefiles... Seems like it would be an extremely useful addition to the shapefiles themselves if there was a project or demo class to automatically style the shapefile to match (within reason) what's visible on the OSM tiles.
I've begun to look into it myself, but getting the labels, colors, zoom levels, etc. set up correctly is proving to be a very time-consuming task. (I realize, of course, that it would be this way for anyone who attempted it...)
So, just curious if this has been done anywhere and I've missed it? Or if there's a listing of built-in line styles -> road types or something of that nature?
Also, I'm curious as to how often the shapefiles are updated (specifically, in my case, for Indiana).. Hope I haven't missed an obvious reference to that, as well.
And most time we will update the Open Street Map once per week. But sometime if you need OpenStreetMap Shapefile data for a country that is not yet available or not updated, you can contact us with support@thinkgeo.com or post in the Forums or submit a ticket.
Gary, I do have a question on OSM for desktop version.
at the stage of this demo, tiles are downloaded and then displayed at once, this means that rendering takes time. Any chance to get a rendering that looks like the web version, I mean tiles renderered as soon as individually donwnloaded and eventually progressively (as google earth) ?
another question is about the cache, it looks like it’s clean each time the demo is launched, any chance to have the cache kept for few days/weeks to get updates but fast initial rendering ?
I was actually hoping to get information on the shapefiles you provide based on the OSM tiles… The tile server is fine, but I hit a ‘zoom limit’… Basically, if I try to zoom in as far as I can with Google maps, I start getting 404 not found errors returned… Maybe it’s just the city I’m looking at, but I’m not sure…
So, instead, I’d like to try using the data from the Indiana.zip file… But figuring out the mappings of dbf data to styles is tedious, at best… :) So, I’m guessing the answer is no, but… Any standard style definitions for the shp data in the downloaded OSM data files? :)
If you want the OSM Data to come into tiles in a Desktop application you should look at the Map Suite WPF Desktop Edition, it uses a tile based system very similar to the web. I don’t see any easy way to accomplish what you want with the Map Suite Desktop edition which uses Winforms.
Jason,
My guess is that you are having an issue related to the ZoomLevelSet and that at certain scales Open Street Map doesn’t know what to serve up. Can you try setting your ZoomLevelSet to the OpenStreetMapZoomLevelSet like the code below and see if the issue goes away?
winformsMap1.ZoomLevelSet = new OpenStreetMapsZoomLevelSet();
Thanks for the response, I don’t know of a good way to add a WPF Map to a Winforms application. This doesn’t mean it’s not possible but I haven’t ever tried it.
If you want more control over the tile cache you can setup your own tile cache and assign it to the OpenStreetMapOverlay.TileCache property. If you are new to using the FileBitmapTileCache object take a look at the “Using Tile Cache” How Do I sample under the Getting Started section.
I set my zoomlevelset as described. Unfortunately, I don’t know if OSM doesn’t have maps available at the closest level or if it’s just in the area I’m looking at…? I get to a point where all of the tile images are just missing.
Like I said, it would be nice to just use the shape files… But styling them is a challenge.
I was able to get some road to display like the attached screen shot using my code below. My guess is that your cache has some invalid tiles saved in it and that is why things are rendering properly. The code below isn't using cachening so once everything is working correctly you can turn cacheing back on if you want.
winformsMap1.MapUnit = GeographyUnit.Meter;
OpenStreetMapOverlay osmOverlay = new OpenStreetMapOverlay();
winformsMap1.ZoomLevelSet = new OpenStreetMapsZoomLevelSet();
//winformsMap1.CurrentExtent = new RectangleShape(-13939426.6371, 6701997.4056, -7812401.86, 2626987.386962);
winformsMap1.CurrentExtent = new RectangleShape(-9577813.36873078, 4791371.58078679, -9577378.22490357, 4791080.98816246);
I removed the cache and still no luck. All blank images. I cleared the cache and it created a ‘19’ folder, and several subfolders. But they were all empty.
Can you zip up your sample project and attach it here? Did you try the code I posted? For OpenStreetMap to work properly the MapUnit needs to be set to meters so that could be it too.
I really appreciate the help. Unfortunately, this ‘simple’ part is taking a bit longer than I’d like, and I need to move on to the more complex pieces of my project. I’m going to come back to this, though.
In the meantime, I’ve created my own Overlay class that I can drop in in place of the OSM overlay which basically just uses the OSM shape files provided by ThinkGeo… I can customize this custom overlay (which I’ve done to an extent) if I need a different look or whatever. It suits my needs for now … :)
There _is_ one exception, though. I can’t get street labels to show up more often. At most, they appear once on the street (for its entire length) and sometimes they aren’t in the visible area at all… How can I change the frequency at which a line label appears? I didn’t see anything in the examples, but I may be blind… (If it matters, to display the streets, I created a ‘DefaultValueStyle’ class that I could use to create custom styles with a default fallback…)
Thanks for your question, take a look at the Draw and Label a nice looking road How Do I sample and see if that is what you are wanting to do. If so you can see how the properties are set on the LocalRoad1 text style and emulate that on your style.
The properties on the text size that will make the most difference for roads are:
Thanks Jason, if you don't have any luck, send us the shapefile, screenshot and bounding box of the area you are working with to forumsupport@thinkgeo.com and we can take a look.
Although we don’t have this type of product currently available for the Open Street Map dataset we do have the World Map Kit. The World Map Kit is a collection of TIGER based datasets and the rendering information for this data. With the World Map Kit adding the styled data to your project is as simply as extracting the raw data and referencing a class file containing all the rendering logic.
If you are looking to have this setup for a specific country our Professional Services department could create this type of rendering class for you and your project.