Thursday, July 26, 2012

Canada, eh?

I'm happy to announce that a topo layer for the canadian rockies is finally live.  The "nrcan" WMS source has always been available from the candian government, but I've wanted to create my own tiled source as well.  Why?

There are 3 sets of topo maps available from the canadian government:
  • Toporama is a WMS layer hosted by Natural Resources Canada, and appears as "nrcan" on CalTopo.com.  It's a vector based layer - all the trails, contours, water features, etc. are stored as lines in a database and then turned into an image using a renderer like Mapnik.
  • CanMatrix is scans of the original 1:50k Canadian topos.  These are what the current layer is based on.  Scan quality only supports going down to zoom 15.
  • CanTopo is a newer, high-resolution round of topo maps.  They appear to be computer-generated, probably from the same vector data that feeds Toporama, but coverage is currently quite sparse.  Image quality supports going to zoom 16; as coverage increases, I will expand the USGS 7.5' layer to include these.
Being a WMS layer, Toporama isn't as speedy as I'd like.  Although it's better than the USGS' vector data, side-by-side comparisons show that there are still a lot of missing trails and forest roads compared to the older paper maps.  Some of the data leaves you scratching your head for context, like short unlabeled trails that start and stop in the middle of nowhere.  And, being WMS, it's not compatible with some of the tiled-dataset tools I'm working on like Google Earth Export.  Not that you couldn't make it work, but it's more development effort.

CanTopo would be the ideal dataset to build a new map layer off, but it doesn't exist for most of the country yet.  The maps I've spot checked look dead on compared to the old paper ones.  I suspect the slow progress is due to the government checking/updating all the vector data before producing the map; perhaps when the full series is available the Toporama data will be equally comprehensive.

That leaves CanMatrix, which works fine but suffers from a couple imperfections.  Some of the maps are NAD27 and others are WGS84; historical NAD27 versions of the newer maps don't seem to be available.  This results in small coverage gaps at the border between maps with different datums.  Many of the older maps, particularly getting up north into the Yukon, are grayscale only.  And finally, the accuracy seems way off compared to the USGS 7.5' series.

I kept iterating on the rendering process because the maps didn't line up well with Google's terrain/satellite layers.  Beyond the datum, if you get the projection wrong it can cause parts of the map to be distorted while others are dead-on, and I thought this was my problem.  Eventually I realized that some of the maps just have massive survey errors (and by massive, I mean 150' - not really noticeable unless overlaying against a reference map).  This results in some noticeable misalignment where map quads meet.

For the US, the difference between the new "US Topo" vector maps and the older paper maps is night and day.  Because Canada's paper maps are worse and vector maps are better, the difference is much less pronounced.  Because of this I decided to only render out the rockies / western coast, where the road and trail information on the paper maps is still critical, and skip the flatter lands in the rest of the country.  If there's interest, though, I can look into expanding coverage.