Wednesday, April 9, 2014

Cursor Elevation

CalTopo can now show the current cursor or center elevation under the coordinates at the top right (continental US only).  At least until I get any performance issues worked out, this is off by default - but you only have to turn it on once, as the choice is saved in a browser cookie.

Previously, you could hide the coordinate display at the top right by clicking on it.  This made it hard to copy coordinates, since selecting them with the cursor would also hide them.  I've removed this feature, and replaced it with a checkbox in the leftbar next to "Show Cursor/Center position":

Beneath that is a new option - "Include Elevation".  Check the box and the current elevation will automatically appear beneath the coordinates:

Elevation data is only retrieved after all the map tiles have finished loading, so when changing zoom or moving to a new location, there may be a short delay before it starts working again.

Friday, March 28, 2014

Better Terrain Identification

While scouting some backcountry ski terrain l last weekend, I had trouble identifying a slope.  I'd taken a photo and could match that to what I saw on the view from here feature, but the slope itself was unlabeled.  I had trouble identifying the nearby peaks - while they were named, entering "abc peak, ca" in the search bar didn't match anything, so I had to start with the general location and pore over the map until I found them.

Once the nearby peaks were identified, it was still hard to figure out exactly which slope I was interested in.  The angle I was looking from made it hard to match ridges and subpeaks to features on the map without a lot of careful back and forth.  And so in my frustration, a new feature was born - sort of a reverse view from here.

Lets do a hypothetical example.  From the top of Half Dome, you see a dome that looks interesting, but you can't figure out what it is.  Fire up CalTopo, enter "half dome" in the search bar, and then right click on the summit and choose "View From Here":

Here's the large-scale simulated view looking up Tenaya Canyon from the top of Half Dome:

And here's the view zoomed in on the mystery dome.  Unfortunately it doesn't have an entry in my USGS-supplied list of summits, so unlike Mendlicott Dome above and to the right, it doesn't get a label:

Previously, identifying this dome would have taken some map legwork.  Now, you can right-click on it and choose the only option available, "Map This Spot":

A new CalTopo map browser will open centered on the spot you clicked:

In this case the mystery feature is Pywiack Dome (note the center graticule on its southern face).

Depending on how long it takes for my server to figure out what point you're looking at, the CalTopo map browser may open in a new window rather than a new tab.  Not ideal, but it's a browser feature I only have so much control over.  When I have more time, I'll see what I can do about that.  Enjoy!

Thursday, March 20, 2014

The Daily Grind

When you start a new project, you can devote 100% of your time to new, exciting stuff.  As the project grows and matures, maintenance and general upkeep take over.  Eventually the cool features, the ones you wake up excited to go work on and change the world with, get pushed to the side.  Sneaking time to work on them begins to feel like a guilty pleasure.

While the day-to-day stuff isn't glamorous, it's still critical to making a useful site.  To help illustrate that work on CalTopo is still alive and kicking in the absence of big-ticket changes, this post is devoted to some of the smaller items from the last couple months.  They are:

Added Degree Decimal Minute support to the PDF generator.

Custom PDF page scales.  You could always choose "not fixed", but now you can snap boxes to a custom scale:

Garmin's USB Mass Storage enabled GPSs behave a little differently, and were sometimes problematic when importing and exporting data.  I had to rewrite some of the GPS interface code to get them working properly.

Provided direct KMZ downloads to GPSs that support Garmin Custom Maps, so a user doesn't have to figure out where to manually copy the file over to.  This is on the same page that lets you export KMLs and KMZs:

My GPX parser isn't perfect, and the KML parser far from it, as KML is a very large and complex format.  I'm now saving all files the parser can't handle.  Most of these are gibberish like shapefiles and tabular data that were uploaded by mistake, but looking through them helps me spot errors without being reliant on users complaining when something doesn't work right.

CalTopo now reports sizes for smaller polygons in acres, in addition to square miles and kilometers.

The find box at the top of the page was interpreting coordinates as WGS84 even when the datum was set to NAD27.

Sorted objects in the left bar by name, rather than creation order:

Improved default "View from Here" quality, and eliminated the "fast" option.  So far this feature hasn't been unduly bogging down my server, so there's no need to keep it restrained.

The coordinate options in the left bar were originally UTM/USNG on top and several Lat/Lng formats on the bottom.  I changed this so that both dropdowns have all five options.  CalTopo will switch over to Lat/Lng on top and UTM on bottom by default, but these choices are saved to your browser so you shouldn't need to keep resetting them:

The big reason for this change is that I can now treat the first checkbox as the user's preferred coordinate system.  I've wanted to allow direct editing of marker coordinates for some time, but the lack of a single, user-specified coordinate system held me back.  It's about time for this change; previously you had to try dragging a marker into the correct spot while watching the coordinates in the screen's top right:

Cookies had been expiring when you closed your browser, so the map center/layers/datum/etc reset every time you came back with a new browser session.  I never noticed this as I rarely reboot my computer and am often clearing cookies for debugging purposes, but those settings will now last for 3 months.

I had been smoothing GPS tracks a bit, in order to prevent bogging down the UI when someone imports, say, a big chunk of the PCT.  By popular demand, this is now optional, although still recommended unless you want the extra precision:

A new stage was also added to the import dialog to give you the option of choosing particular markers and shapes rather than pulling in everything and then deleting the stuff you don't want:

There were some coordinate formats I wasn't parsing right, like last 5 UTM and using 120.1 W instead of -120.1 for longitude.  Fixed what I could, if you run into something that doesn't work right, let me know.

Added bearing lines, so that you can plot a line at a compass bearing from a given location.  Useful for SAR for coordinating ELT signals and voice calls, not sure what how much use it will have for general mapping.  Note that when drawing a new line, range/bearing from the last vertex is displayed at the top right of the screen, which may also be helpful.

You can now print a list of marker coordinates along with a map.  This used to exist but partially broke at some point.  It's accessible at the bottom of the PDF generator:

GPX exports - and consequently, GPS exports - added a bunch of extra data into the description field so that if you re-imported the file, it would preserve colors, marker symbols, comments and so on.  Unfortunately all this data would sometimes show up on GPSs, which is more than a little annoying.  Exports are now plain vanilla GPX.  If you want to back up a map or copy features from one map to another, the export dialog now has an "Include Attributes" checkbox.

This is a pretty obscure feature, but if you're setting up a website and want to make use of embedded CalTopo maps, you can import a KML file by listing it as part of the URL hash, e.g. ending with &kml=http://location/of/kml/file.

Some more options for getting detailed information on a point:

Sun Exposure was covered in the "Where's the Sun?" post.  The NOAA Forecast option brings up a point forecast page on  Position & Elevation brings up a dialog with elevation/slope/aspect as well as the coordinates in a variety of formats:

The "Layers" section on the leftbar simply provides a preset combination for the layer menu at the top right.  This proved to be too subtle as many people thought these were the only options and missed the layer menu entirely.  In order to make this visually obvious, I'm now briefly flashing the layer menu whenever someone clicks on a preset.

Similarly, a lot of people missed the slope and land management keys at the bottom right of the map screen.  These are now shown directly under the checkbox, although to avoid UI clutter, they only appear when a layer is active.  The keys are currently cropped instead of flowing onto a second line, but they still convey the general idea:

Saturday, February 15, 2014

Where's the Sun?

It's a simple question, but one I haven't found a satisfying answer to: where's the sun?  How do you look at a map and figure out which areas are mostly sheltered from its rays and which ones receive strong midwinter sun?  When will your campsite first see direct light in the morning, and will it have a good view of the sunset or be smothered in shade hours beforehand?

When I built the viewshed layer, I realized that I could use the elevation data and techniques from it to create all kinds of cool terrain-driven visualizations.  One of the more obvious ones was a sunlight analysis layer that could answer the above questions without the need for napkin math and a protractor.  After a lot of work finding the right balance between accuracy and performance, it's finally live.

You can add a sunlight analysis layer just like viewsheds and slope shading:

Specify a date, and either pick a specific time or get an average across the entire day:

Click OK and it shows up as a layer checkbox, just like the other custom layers:

Testing these layers is always more fun than building them.  A good opportunity was heading out to the Sierra Club's Bradley Hut to check on snow conditions for an upcoming overnight trip, coupled with California's serious drought conditions.  Solar warming isn't a reliable predictor of snow depth, and my shading doesn't even factor in vegetation like trees.  Still, it seemed like a good test case.  The route follows the dashed black road in from the red highway, cuts North to a creek crossing, and then continues up the far side of the image below.

The layer uses a blue-yellow-red spectrum, where blue is completely shaded, red represents the maximum amount of sunlight a slope can have on that day, and yellow is 50%.  The coloration is based on how directly the sun shines on a slope, so glancing light counts less than direct, full-on illumination.  It doesn't account for all factors, but the goal was to provide a rough picture of the sun's effects, not exact measurements.

The blue areas in the picture below held snow well.  The red-tinted slopes beyond the bridge were melted out ("no snow") while the yellow spots on the approach were simply thin.  Rough correlation achieved.  Success?  Maybe.

Taking one of the last lifts up KT at Squaw on Friday, the sun was low enough to cast shadows across GS Bowl.  I noted the time, came home and punched it into CalTopo.  The first image shows the terrain with simple sun/shade coloring, the second has the "adjust for intensity" box checked.  The sunlight layer only provides 15 day and 15 minute increments, so I'm not expecting an exact match, but the top of Olympic Lady and upper part of Red Dog Ridge are in the sun, with the lower reaches shaded.  Close enough.

Yellow = direct sun, Blue = shaded

Blue->Yellow->Red spectrum "adjusted for intensity"
But wait, there's more . . .

Since I'd already done the hard work of computing the sun's position and tracing along its path, it didn't take long to throw together detailed year-round information for a specific point.  Right click on a map, choose Point Info and then Sun Exposure.

The dialog below shows day/night and sun/shade information for the current year.  The x axis is time of year, with Jan 1 on the left and Dec 31 on the right.  Y axis is time of day, ranging from earliest sunrise to latest sunset.  Gray = night, Blue = shaded and Yellow = direct sunlight.  Mouse over a point on the graph and you'll get the corresponding date/time as well as the sun's azimuth and altitude at that point.

Sun exposure for the Upper Pines campground in Yosemite

Back when the internet was far less mature and AltaVista ruled the search scene, one of the photographs I always wanted to take was of the sun setting across the Golden Gate Bridge.  At the time I could never figure out how to make that happen, except for watching the sun for months on end and waiting for it to align.

Although no longer on my to-do list, the project seemed like a good way to demo integrating sunlight information with other features on CalTopo.  Step 1 is to shoot a bearing from Treasure Island across the Golden Gate:

You can go back and forth with what part of Treasure Island you want to shoot from and where you want the sun to cross the bridge, but I got a bearing of 260 degrees:

Assuming you want the sun to be just over the horizon, the sun exposure table gives me an altitude of 3 degrees at an azimuth of 261 degrees on March 7:

The bridge is 746' high and Treasure Island is 29000' away, so the tower tops will be atan(746/29000) = 1.5 degrees above the horizon, so even this is maybe a couple days too late.  However most people would take the photograph from farther South on the island, in which case you'd want to go a little later.

From photographers to backcountry skiers to car campers, everyone can benefit from a good pre-plan.

Wednesday, February 5, 2014

CalTopo - Now With SNOTEL

The lack of recent posts doesn't mean a lack of development, only that the focus has been on bugfixes and minor improvements - from better compatibility with USB Mass Storage capable Garmins to decimal minute support in the PDF generator.  Still, for the last couple months two new layers were lurking in the background, getting brief bits of attention during downtime as I tried to wrap them up before the height of ski season.  The first of these is the SNOTEL data layer.

For those not in the know, here's the one-line description stolen from Wikipedia:
SNOTEL is an automated system of snowpack and related climate sensors operated by the Natural Resources Conservation Service (NRCS) of the United States Department of Agriculture in the Western United States.
SNOTEL has about 850 sensors, mostly in remote locations, that issue hourly reports on the snow depth, snow water equivalent and air temperature.  Some of those also record wind speed/direction, solar radiation and other measurements.  While the system was designed to track the nation's water supply, it also provides a wealth of information for winter time backcountry travel.

SNOTEL locations across the Pacific Northwest.  Blue sites have wind data.
In my experience, accessing real-time SNOTEL data is inconvenient enough that I often don't bother.  The web site requires you to visit each station separately and pull up a chart; there isn't a good way to survey nearby stations at a glance.  They publish a KML file with recent station data, but it emphasizes percent of normal snowpack rather than current snow depth.

This isn't a criticism of the folks running SNOTEL, as backcountry recreation is very much a secondary use of the system.  Plus, they've been kind enough to make all the data publicly accessible through a webservice, so that people like myself can pull it into their sites and chart, graph and display it every which way we want.

So enough with the background, I'm happy to announce SNOTEL as the first dynamic, data-driven map layer in CalTopo.  It should show up as a checkbox just like the other overlay map layers, but here's a link as well.  In order to avoid overwhelming the SNOTEL servers, at low zoom levels you'll just see a map of all stations.  Standard stations are in red, stations with wind sensors in blue.

SNOTEL stations around North Lake Tahoe
Zoom in a couple levels and each station gets a label with the snow depth in inches, the current snow density (10:1, 5:1 etc) and current temperature.  Hover over a station for a few more details.

Click on a station to bring up a dialog with the 7-day sensor history and a link to the station's official webpage, where you can check out all kinds of additional charts and tables.

Each station reports snow depth, water equivalent and temperature separately, and those updates can take a while to reach the main system.  CalTopo displays the oldest date between those 3 sensors; if the photo above were taken at 9:05, snow depth could easily be as of 9PM while air temp is as of 8PM.

Another important thing to know is that the SNOTEL data can be pretty noisy, especially the snow depth reading.  If anything looks funny, it's best to click on the station and get a detailed graph.  Notice how snow depth (black) for the station below appears to drop during daytime highs (red):

Saturday, October 19, 2013

New Land Management and Fire History Layers

I've recently added two new layers to CalTopo, both built built on government datasets but with homegrown rendering.

Northern California burning
The fire history layer shows wildfire activity since 2000.  There are some regional datasets that go back much further, but this was the best I could find for national coverage.  Fires are color-coded by year along a yellow-red spectrum, with yellow fires being the oldest and red being the newest.  Exact dates are listed in the map info pane at the bottom right.

I've tried to show both the year and incident name for all fires.  Large fires are labeled as you begin to zoom in, and then all fires at the lower zoom levels.  Unfortunately, in areas with overlapping fire perimeters, it can be hard to figure out which label belongs to which fire - and some of the overlapping incidents even share the same color.

Large incidents labeled at moderate zoom

The second layer shows public land management (technically, the "surface management agency").  While data for this layer is sourced directly from the government and seems reliable if a touch dated, hunters should verify with a second source - don't blame me if something's mislabeled!

A wide mix of agencies in Southern California
As you zoom in, the polygons change from opaque-ish to translucent with borders, just like the fire layer.  I chose not to label them as national forests were the only areas with unit designations, e.g. Tahoe National Forest; most areas are simply attributed to BLM or state ownership with no further information.

National Forest boundaries - have they ever made sense?
I'm open to modifying the colors used for various agencies.  While I tried to follow existing map conventions as best I could, there are only so many options available and I can see how some might cause confusion: the Bureau of Land Management and Bureau of Reclamation are both orange, but I don't know how similar their rules on activities like hunting and camping are.

Public land management in the continental US

Tuesday, October 15, 2013

SARTopo - CalTopo for SAR

CalTopo started as a project to provide better maps for search and rescue.  As I focused more effort on, the SAR version lagged behind and it became harder to bring new features from CalTopo back to the SAR code.  This summer I put a lot of effort into reworking things, and while CalTopo hasn't seen many new features, the SAR version is finally ready for a re-launch.

So without further rambling, I give you - CalTopo for SAR.  SARTopo takes the existing CalTopo UI that you've learned to at least live with if not love, and adds additional search and rescue object types like operational periods, assignments, clues and resources.

These extra objects make it easy to do things that are cumbersome at best with traditional mapping software: editing the same dataset from several computers, printing assignment maps on multiple backgrounds, dumping segments to GPS, filtering stray tracks and waypoints, color-coding data by operational period or resource type, and a lot more.

I encourage anyone involved in search and rescue to watch this 3.5 minute video and then give it a try at

Both the software that makes this happen and the map layers I've created are available for free to search and rescue teams.  You can load them on a laptop and run a mobile version of SARTopo in the field, miles from the nearest internet connection, with statewide map data including USGS topos, USFS topos, aerial imagery, shaded relief, contour lines, slope shading, viewshed analysis and even the "view from here" feature.

For more information on offline use, please visit

Assignments, Clues, Resources: some of the added SAR features

Now that SARTopo is finally live, I look forward to returning more attention to CalTopo, and several new feature blog posts are coming shortly.