Michal Migurski's notebook, listening post, and soapbox. Subscribe to this blog. Check out the rest of my site as well.

Dec 20, 2011 7:33am

OSM terrain layer: come and get it

TL;DR: We’re making the terrain map available as a US-only tile layer. It has shaded hills, nice big text, and green where it belongs. The map is made of 100% free and open data, including OpenStreetMap for the foreground and USGS landcover and national elevation for the background. Code here.

Left unchecked, I’d hack at the map indefinitely without launching anything. This week I shaved a few final yaks and now there are U.S. map tiles for you to use, along with an interactive preview. Tile URLs come in the same format as other slippy map tiles, they look like this:


You can add a subdomain to the beginning to help pipeline concurrent browser requests, e.g. a.tile.stamen.com, b.tile.stamen.com, up to d.

The source for everything is on Github, but it’s in a messy, half-described state which Nelson Minar is helping triage and disentangle.

Notable Yaks

The street labels and route shields for this map probably accounted for the majority of the time spent. I’m using a combination of Skeletron and route relations to add useful-looking highway shields and generate single labels for long, major streets. One particular OpenStreetMap contributor, Nathan Edgars II, deserves special mention here. I feel as though every time I did any amount of research on correct representation or data for U.S. highways, NE2’s name would come up both in OSM and Wikipedia. He appears to be responsible for the majority of painstakingly organized highways on the map. Thanks, Nathan!

Skeletron also helped handle the dual carriageways, a common peculiarity of geographic street data where the individual sides of divided roadways are in the database as separate one-way lines, visible in the image of Stanford above. It can make for some pretty frustrating renders (the “MarketMarket DoloresDolores GuerreroGuerrero” problem I’ve mentioned before) so I’m literally processing every major street in the continental United States at a range of four different zoom levels to do the merging. There’s a great big code repo showing how it works; skeletron-roads.sh is the important part; I’ll get some shapefiles posted someplace useful in the near future.

I’ve done a bit of High Road-style work with town names to figure out the range of representations in OpenStreetMap, and I think I’ve figured out a scheme for about zoom 12 and above that allows major cities to show at high priority and not flood the map with a layer of useless GNIS “hamlets” like Peralta Villa. It still looks wrong to me in places, but it’s a lot better than OSM’s omission of Boston in favor of Cambridge until zoom 10.

I’m thinking that Stamen can probably commit to OSM updates about once every month or so, since we’re not Frederick Ramm and have to do them semi-manually. Because this map style makes such an explicit and noticeable difference between major and minor roads, I’m expecting many resulting changes to be road classification edits. For example, Nathaniel reclassified a bunch of streets in his hometown of Eureka from residential to tertiary or secondary to reflect the major routes around town, and now they are labeled more usefully at lower zooms.

Pretty Pictures

I love this image of Lake Shasta, with the sharply-rising hills around the land and Interstate 5 loping through. This is the northern end of the Central Valley, and the landscape here rapidly shifts to larger, more complex hills as you move north.

Madison, Wisconsin sits between two lakes, and there is a small plaque on the southwestern side of the state capitol building showing how deep under ice you’d be at the same spot 15,000 years ago. I like how the regular grid of the town adapts itself to that narrow spit of land between the two lakes, which I’m told are good for ice fishing and driving during the winter. Thanks to NACIS, I spent a fun few days here in October.

The interaction between the suburban cul-de-sac development and the foothills in this part of northeast Colorado Springs renders well with the warm sunlight on the northwest slope. I’d be curious to know of there’s a difference in property prices here, maybe between the southern exposures to the right and the northern exposures to the left?

I continue to be fascinated by the topography of the Appalachians. Birmingham has this incredible swirl-hill to its immediate southeast, and I wonder if any of these large-scale structures are obvious at ground level when you’re among them?

Comments (22)

  1. Wow, pretty pictures! I am really curious what software u used to create this hillshade layers. Maybe I can help to create this for other parts of the planet.

    Posted by Coen Nengerman on Tuesday, December 20 2011 9:32am UTC

  2. Oh, there is more on your blog about this. Let me read that first :-)

    Posted by Coen Nengerman on Tuesday, December 20 2011 9:49am UTC

  3. wait, you spent several days in Madison in October and failed to tell me?!

    Posted by wes on Tuesday, December 20 2011 3:21pm UTC

  4. I put a simple viewer for the map tiles here: http://www.somebits.com/multimap/map.html It's got a few features to make it easier to compare this map to other open maps, also make bookmarks for sharing or bug reports. Source is at https://github.com/NelsonMinar/multimap Congratulations on the launch, Mike! The map is looking fantastic.

    Posted by Nelson on Tuesday, December 20 2011 4:22pm UTC

  5. Seattle came out quite nicely, though the street grid detracts from the rendering of hills: http://twitpic.com/7vxh5u

    Posted by Hans Gerwitz on Tuesday, December 20 2011 5:44pm UTC

  6. This output is really terrific.

    Posted by jwb on Tuesday, December 20 2011 5:45pm UTC

  7. Thanks! Coen: https://github.com/migurski/DEM-Tools is the hill part, plus a serving of TileStache Composite (http://teczno.com/s/8xs). Wes: err… =\ Hans: do you think it's just that the street grid is too prominent? Or maybe at that zoom level the hills aren't prominent enough to get nice, deep shadows? Been thinking of pumping them up a little at lower zooms…

    Posted by Michal Migurski on Tuesday, December 20 2011 7:25pm UTC

  8. Interesting area here: http://c.tile.stamen.com/terrain/preview.html#15/40.0171/-78.1976 Note the old Turnpike grade ("Pike 2 Bike") and the new cut.

    Posted by NE2 on Friday, December 23 2011 12:08am UTC

  9. Crazy: http://en.wikipedia.org/wiki/Abandoned_Pennsylvania_Turnpike

    Posted by Michal Migurski on Friday, December 23 2011 2:11am UTC

  10. To answer your question about Birmingham, yes. At ground level Birmingham feels like a series of long ridges and long valleys. In particular, downtown is flat, but the northernmost ridge (Red Mountain) forms the most distinctive topographic feature in the city. Generally speaking, you can only see the nearest ridge. None are particularly tall, so the especially dramatic ones south of town don't stand out any more than the smaller ones closer in.

    Posted by Patrick on Monday, December 26 2011 3:08pm UTC

  11. Hey Mike and all, This tile set is great. Thanks for all of your hard work. One question after looking at the preview: At all zoom levels the city names are showing up at a very inconsistent displacement distance and angle from the town spot. Of course I assume that this is only natural [and desirable] as the labeling engine attempts to fit cramped and otherwise overlapping names. However, most times there is no fit issue, and to my eye the distance is too great.

    Posted by Sam Pepple on Monday, December 26 2011 4:44pm UTC

  12. Sam, thanks for the feedback! The labeling engine does attempt to pack text close to each town spot. I'm limited somewhat by only having direct access to the text bounding box and not the geometry of the letters themselves, so there's a bit of safety margin you're seeing that I'd like to get rid of as well. How many pixels of distance would you expect to see?

    Posted by Michal Migurski on Monday, December 26 2011 7:17pm UTC

  13. That is a good question; I think consistency is generally more important than the right distance. The OSM styling I have been working on has been in SLD. http://style.demo.opengeo.org/live.html Within the rendering capacity of GeoServer I specify a displacement of 3 px of X and and Y of 2 px (roughly 45 deg) off of the bottom left corner of the text box. Unfortunately I am limited to one angle of displacement for each zoom within the style. I happen to prefer the upper right 45 and thus use it here. However, when hand-placing city names on static maps, I will try to have the type peel off the label with relation to the other dots on the page=> if the town spot is in the top left of the page the label will peel off that way and so forth. I really wish that my rendering engine could be instructed to think a little bit more like that, but I digress.

    Posted by Sam Pepple on Monday, December 26 2011 8:25pm UTC

  14. I built a few preferred-placement features into Dymo (https://github.com/migurski/Dymo) which is why the west coast looks the way it does at this zoom level: http://tile.stamen.com/terrain/preview.html#5/40.809/-121.086 I think I'm giving everything too much room to breathe, though. Normally this is to ensure that Mapnik doesn't cause labels to collide with one another but there are ways to fine-tune that behavior I may look into.

    Posted by Michal Migurski on Monday, December 26 2011 8:43pm UTC

  15. This is a really beautiful rendering. The typography is great, though my favorite part is that the label density and street widths are really, really good -- it feels more like a paper map than any other digital map I've used. The only one that comes close is Microsoft/Bing, but I think this still wins: http://i.imgur.com/KsBqC.jpg

    Posted by Andrew Filer on Tuesday, December 27 2011 3:27am UTC

  16. Thanks, Andrew!

    Posted by Michal Migurski on Tuesday, December 27 2011 7:38am UTC

  17. http://www.somebits.com/multimap/map.html#11.00/44.3459/-74.0946 This looks really pretty, Michal. Nicely done. One thing, though, is that at the URL above, Saranac Lake disappears between levels 11-14 inclusive, yet is present at 10 and 15, Then it disappears again at 18. It's as important as Lake Placid or Tupper Lake.

    Posted by Russ Nelson on Tuesday, December 27 2011 10:12pm UTC

  18. Oh, and yes, the Abandoned Pennsylvania Turnpike is excellent. I've got to get down there and bicycle it one of these years...

    Posted by Russ Nelson on Tuesday, December 27 2011 10:14pm UTC

  19. Thanks Russ! I suspect the reason for Saranac Lake's disappearance is that it doesn't have a population in OSM and falls prey to my limits on having too many mystery GNIS towns show up. Z10 is the last place where the Geonames-derived towns are used, and Z11 is the first place where the OSM ones are. I probably need to do better at integrating those two data sets. http://www.openstreetmap.org/browse/node/158836364 - I'm adding the population now.

    Posted by Michal Migurski on Tuesday, December 27 2011 11:08pm UTC

  20. Wow, this looks absolutely fantastic, thank you for the work! I've been looking around my sometimes home town (which certainly is terrain-heavy), and this is one of the better renderings I've certainly seen. http://c.tile.stamen.com/terrain/preview.html#13/39.2693/-106.4424 Is there any plan down the road to add additional feature types to the higher zoom levels, like a topo map? Or is the intent to keep things more "clean"?

    Posted by Jake on Wednesday, January 11 2012 12:30am UTC

  21. Thanks, Jake! I would like to add features like schools and named buildings at higher zoom levels, as long as they don't add too much visual noise to distract from the background intent of the map. The terrain near your hometown is amazing; Montana is another favorite place to pan around.

    Posted by Michal Migurski on Wednesday, January 11 2012 1:28am UTC

  22. Hey Mike, A researcher friend of mine mentioned these maps and lo and behold, I know the creator! Your view of Madison in the above post includes my house. Let me know if you need a sofa bed to crash on to do some ice-fishing research. Long time no see. My email (in spambot-unfriendly format) is first initial, last name at gmail.

    Posted by Mike Quieto on Sunday, February 12 2012 5:52am UTC

Sorry, no new comments on old posts.

June 2024
Su M Tu W Th F Sa

Recent Entries

  1. Mapping Remote Roads with OpenStreetMap, RapiD, and QGIS
  2. How It’s Made: A PlanScore Predictive Model for Partisan Elections
  3. Micromobility Data Policies: A Survey of City Needs
  4. Open Precinct Data
  5. Scoring Pennsylvania
  6. Coming To A Street Near You: Help Remix Create a New Tool for Street Designers
  7. planscore: a project to score gerrymandered district plans
  8. blog all dog-eared pages: human transit
  9. the levity of serverlessness
  10. three open data projects: openstreetmap, openaddresses, and who’s on first
  11. building up redistricting data for North Carolina
  12. district plans by the hundredweight
  13. baby steps towards measuring the efficiency gap
  14. things I’ve recently learned about legislative redistricting
  15. oh no
  16. landsat satellite imagery is easy to use
  17. openstreetmap: robots, crisis, and craft mappers
  18. quoted in the news
  19. dockering address data
  20. blog all dog-eared pages: the best and the brightest