Saturday, December 10, 2011

Introducing the 40' Contour Layer

I've just added a contour line layer to CalTopo.  Current coverage is California only, although it will be expanded to the western US during the next month or two.  California provides its elevation data online; for the rest of the country, you actually have to mail a hard drive to the USGS.  What is this, the 90s?

The contour lines are the first in a series of what I'll call "transparent overlay" layers; these are vector data drawn on a transparent background that show up as checkboxes in the overlay selection box.  The contour layer is intended to sit on top of aerial imagery; in an environment without trails or roads, combining it with shaded relief can provide better terrain visualization than a traditional topo.  The other benefit is that by printing an aerial+contour map and a traditional topo, it becomes easy to match locations between the two.

One difficulty in creating the contour layer was choosing a line color.  Traditional USGS brown works great on topo maps because it only has to mix with a couple colors, all light.  Aerial images have a much wider range, and a noisier background.  The USGS has decided to stick with brown for its "US Topo" aerial-based maps, but I find the lines difficult to follow, especially on prints.

The other issue was line weight.  Too thin, and they're hard to follow; too thick, and you start obscuring details in the underlying map.  Red seemed like a good bright, unnatural color, but it didn't mix well with CalTopo's SAR origins: autogenerated assignment and debriefing maps use red for the line color.  I also found that my brain was accustomed to brown, and that bright colors were harder for the back of my mind to turn into a mental terrain map.

Parts of Europe use orange for their contour lines, and in the end I settled for an orange-brown color.  Is it perfect?  Probably not.  Does it get the job done?  I think so.  Hopefully you agree.

Top of Avalanche Gulch, Mt Shasta

Thursday, December 8, 2011


A little bit of history . . .

I decided to build while standing in the Skeggs Point parking lot above Woodside, CA at 4AM in the summer of 2009.  I'd just been headed to bed when the SAR pager went off for a missing hiker, so I sent a quick email to work letting them know I wouldn't be in the next morning, threw my gear together, and started driving.

We'd run into it before, but this search was particularly bad: our topo software didn't have any of the park trails on it, and the park brochure didn't have any contour lines.  It was almost impossible to translate positions between the two; you could get a GPS reading and place yourself on the topo map, but still have no idea where the nearest fire road was.  Standing in the command post looking at maps under a work light, I thought: there has to be a better way.

It took me a while to figure out exactly what that would be.  Through a lot of trial and error, I wound up creating the map viewer that is at the heart of CalTopo today: a web map viewer with UTM grids, datums, multiple layers blended together, and so on.  However, I still couldn't get anyone interested in using it, because I didn't have any decent maps.

If you had an internet connection you could use Terraserver's USGS scans and MyTopo's map layer, but they both left you felling a little wanting: Terraserver's scan quality was low, and while MyTopo's maps looked great on the screen, they didn't print well.  I don't know whether it was an intentional degredation of their free service or a byproduct of the way they composite base USGS maps with relief shading and updated road/trail data, but their prints came out blurry.

All of that aside, a lot of searches take place in areas with weak or nonexistent internet connections.  Our comms van has a satellite uplink, but stick it in the bottom of a canyon with heavy tree cover and it's useless.  Clearly, if this project were to go anywhere, I needed my own map layers.

Fortunately, California has high-quality topo scans, aerial imagery and elevation data available online at  I didn't really know what I was doing at first, but with enough perseverence, I managed to learn how to use GDAL to stitch together individual maps into a single layer and then render the results out to 256x256 pixel web-map compatible tiles.  After letting my laptop work overtime for a couple months, I had 12 million tiles covering USGS maps, USFS maps, relief shading and aerial imagery for the entire state.

I then had another problem: volunteers don't work in SAR command posts that often.  It's hard enough to get them trained on off-the-shelf products that you can use at home, like Terrain Navigator Pro; good luck developing a userbase for a SAR-specific product from scratch.  I needed something that people would want to use in their daily lives to get them acquainted with the product.  So I added the ability to draw lines and markers on the map, removed the SAR-specific features like command posts and search assignments, uploaded all my map tiles to Amazon S3 and created

So that's the backstory.  The site exists, and I feel like I need to do some marketing for it.  The actual map viewer isn't a very good candidate for the Google SEO game, and I'd like to avoid the keyword-linkfarm approach of loading a bunch of place names into a database and creating dynamic-but-static-looking placeholder pages that eventually just link you to a particular lat/long in the map viewer - go search Google for an obscure place name like "bravel slough merced" for an example.  So - why not a blog?

In addition to communicating new features and updated map coverage for CalTopo, I'll use the blog to write about some of the things I've learned from creating the site and other GIS and mapping related topics.