Thursday, February 28, 2013

Printing PDF Topo Maps (and Map Packs)

CalTopo has supported PDF printing for a little while, but it was tucked away until I made sure that generating the PDFs wouldn't overload my server.  It's now front and center in the UI, along with higher resolution PDFs and an important new feature - multi-page map packs.

First off, clicking the print icon in the top right will no longer bounce you straight into browser print mode.  Instead it brings up a menu for choosing between browser printing and the PDF generator:

The new print menu
The PDF option was initially tucked away as a link on the browser print screen, built out to satisfy some grumbling users who wanted exact 1:24k prints.  Since then I've found myself using it almost exclusively - the prints are higher resolution and you aren't limited to a fixed set of zoom levels.  It seemed time for a promotion to first-tier status.

Now for the good part - when you choose "Create a PDF", you can mark up to 15 pages on the map and dump them into a single PDF file for printing.  Here I've marked several pages on a user's Big SEKI Loop map, all with a 1 inch : 1 mile scale:

When I click "Generate PDF" they come back in a single file, along with an overview page that shows how the maps are positioned relative to each other:

The first page of the PDF shows individual map placement
So try it out!  You can also check out a sample 1:24k PDF of the popular Bunny Flat routes up Shasta, with slope shading.

Please note that this may become a paid feature at some point, depending on how much extra work it creates for my server and the degree to which I need to make a living off CalTopo.

Wednesday, February 27, 2013

Improved Elevation Profiles

Elevation profiles have been a bit of a weak area on CalTopo.  You could draw a profile and get point elevation data along the path, but that was it.  The profile function has now been updated with a couple key features:
  • More sample points used
  • Distance measurements provided for the x-axis
  • Gross elevation gain and loss calculated
  • Horizontal sampling interval and vertical exaggeration shown
  • Climbs and descents marked with distance and elevation change

Here's an example profile:

 And here's what it used to look like:

Using the data rendered for custom DEM shading, I was hoping to update the elevation profile with slope and aspect data as well.  I've seen some cool circular plots of elevation v. aspect and slope angle v. aspect, and thought those would be a nice addition.  However after playing with an elevation v. aspect graph, I've concluded that they're only useful for a narrow subset of routes.  On ridgelines, summits and valleys the aspect can bounce around dramatically over very short distances.  This leads to a graph that exaggerates aspect swings at best, or turns into a useless and confusing mess at worst.

Instead, I've incorporated that data into a "point info" feature that will give you elevation, slope and aspect readings for any spot in the continental US.  I don't know how useful this will be, but it's more of a temporary bridge until I find a better way to provide this data in graph form.  Note that because the point info feature uses CalTopo's elevation data and the profile graphs rely on Google's elevation service, there may be small discrepancies between the two.

Selecting the Point Info tool.
Not the most exciting dialog you've ever seen:

Wednesday, February 20, 2013

New Visitor Maps

Visitor maps - the nice brochures they give you at park entrances or the giant Forest Service road maps with nary a topo line on them - aren't terribly useful for backcountry navigation.  However they can be great for visualizing roads and trails at a 10,000' view and then switching over to other layers as you zoom in.

My first pass at a visitor layer involved manually downloading PDF and TIFF files, erasing areas outside the park boundary, lining up 4-5 points on each map with real world coordinates, and then tiling them.  Where parks and forests met with curvy borders, erasing everything outside their respective borders was painstaking.  Goof one of the alignment points and I had to delete the existing tiles and then re-tile the map.  I got pretty good coverage for California and then gave up.  It was simply too much work and too little benefit.

Since then the park and forest services have done a better job releasing maps as GeoTIFFs and GeoPDFs, and I felt like it was time to take another pass at visitor maps.  In order to avoid the cropping issues that cost me so much time in the first iteration, I went with two layers, one for the NPS and one for the USFS.  There are almost no contiguous national parks, so I could render the park maps as-is without cropping.  Forest Service land is a different story, and after investing too many hours tweaking an edge-detection algorithm I said "good enough".

The original visitor layer.  Although close, it's not a perfect fit with the aerial imagery.  This is partly the map's fault, and partly my inability to perfectly georeference and warp it.

In the new NPS layer,  streams in Tuolumne Meadows line up dead-on with aerial imagery.

New USFS layer.  The automated cropping left a little bit of the left map's border in place.
As the NPS and USFS continue to release new versions of their maps, I'll be able to grow these layers to match.  The bad news is that I now have 3 visitor map layers.  I'll eventually be able to pull the original, but not until all forests in California get updated maps, which likely won't be for a while.  And there will probably never be a good way to get NPS and USFS maps back together in one layer - but if there's one feature that defines CalTopo, it's the ability to mix and match multiple map sources on the fly.

Wednesday, February 13, 2013

New Forest Service Maps

Without much fanfare, the Forest Service recently redid its 7.5 minute quads.

The previous version, on CalTopo until now, was called the Primary Base Series.  They were produced "back in the day", offset printed, and then scanned into TIFF files.  They had roads and trails that were lacking on USGS maps, and perhaps just as critically, numbered road designations.  However they only existed for some forests, and these manmade features were quite a bit out of date.

These have now been replaced by a new, computer generated iteration called FSTopo.  Because the maps are rendered straight into a graphics file, they look nicer and have a higher resolution than the PBS series.  Coverage includes almost all national forest lands, including Alaska.

Unfortunately, while the FSTopo maps have some updated information, they're still a little out of date compared to actual roads and trails on the ground.  Even without any updates, the increased coverage and higher resolution would still make them a huge step up over the previous maps.

FSTopo has replaced PBS as the default map for "US Forest Service" and any saved maps or URLs will be automatically upgraded.  If you need access to the old maps, you can still get to them under Available Data Sources, as "USFS PBS".

Tuesday, February 12, 2013

Custom DEM Shading

While rendering the new slope shading layers, I also rendered data tiles for elevation, slope and aspect.  CalTopo can now use these to create custom shading for the continental US.  Want to color all north facing aspects above 7000' and steeper than 32 degrees blue?  Create an elevation relief map?  No problem.  Unfortunately I haven't had time to create a slick UI, so the purpose of this blog post is to serve as documentation.

Click the checkbox for the "Custom Shading" overlay layer and a text area will appear.  Use this to enter condition-color combinations, one per line.  The conditions can be any range of slope, aspect or elevation; the color is an RGB hex code.  This is best explained with some examples:

s15-30 FF0000
s30-45a90-270 0000FF

Slopes between 15 and 30 degrees shaded red, as per the first line

The first line will cause all slopes between 15 and 30 degrees to be colored red (#FF0000).  The second shades all slopes between 30 and 45 degrees, with aspects between 90 and 270, blue (#0000FF).  If you're not familiar with this notation, search for "hex color codes" or play with the W3Schools color picker.  You can also use elevation in meters, or append the number with an f for feet

e1000-2000 matches all elevations between 1000 and 2000 meters.
e5000-7000f matches all elevations between 5000 and 7000 feet.

Each line can match one range each of elevation, slope and aspect, represented by the letter e, a or s and followed by start and end numbers separated by a hyphen.  So e7000f-30000fs32-90a225-45 would match all north facing slopes greater than 7000' and 32 degrees or steeper.

North facing slopes above 7k and 32 degrees or steeper

If you have only one condition, you can specify a pair of colors to create a gradient.  The following creates two gradients: elevations between 5k and 7k are shaded white->blue, and elevations between 7k and 9k are shaded blue->red.

e5000f-7000 FFFFFF-0000FF
e7000f-9000 0000FF-FF0000

Mountains around Squaw Valley, CA shaded using the above gradients
You can also use the service to create nationwide visualizations.  And custom layers will also print using CalTopo's PDF generator as well!

A high level view of terrain 25 degrees and steeper in the Pacific Northwest.