Tag Archives: mnr

MNR DEM tiles

So I got the DEM tiles for my zone, couriered from Peterborough. Even zipped, they are several gigabytes. Here’s a visual guide to the tiles I got:

It seems that every project I work on is split across several tiles. My fair city is no exception:

Most of the city is in tile 87, but the northern and eastern corners poke into tiles 91 & 92. Merging the files and pulling out the area isn’t that hard.

First off, we need to know the extents we want. Conveniently, I’d already transformed the Open Toronto data to the same CRS, so I could just go from the extents of one of the city shape files:

$ ogrinfo -al ../open-toronto-shp/dest/2958/city-wards/TCL3_ICITW.shp | grep '^Extent'
Extent: (609538.195527, 4826360.800158) - (651613.577420, 4857439.389359)

You can then use gdal_merge.py to merge the tiles. Annoyingly, rather than using the familiar ‘lower left – upper right’ coordinate convention for bounding box, it uses ‘upper left – lower right’, so working out a buffered bounding box is a bit of a pain:

gdal_merge.py -v -of EHdr -o Toronto.flt -n -9999 -ul_lr 609000 4858000 652000 4826000 `find . -iname 'd*.flt'`

The MNR DEMs are shipped as ESRI .hdr Labelled files, 32-bit floating point. The CRS used is NAD83 Zone 17N. For all that they’re large, they’re quite quick to load and move around.

Land Information Ontario – or, how I semi-accidentally ordered 3.5GB of terrain data

The Ontario Ministry of Natural Resources has a fairly well-hidden service that provides free geodata to the general public. One has to register with a sign and e-mail form, but there’s a large number of useful data sets available. The only disadvantage is that you can’t tell if your order will be delivered by download, or physically burnt to DVD and mailed from the MNR in Peterborough. The municipalities shown above were a download; the DEMs of my entire UTM zone? They’re in the mail …